Documentation
¶
Index ¶
- Constants
- Variables
- func GetTargetFromRequest() func(r *http.Request) (sandboxId string, port uint64, err error)
- func SandboxSharedHostDomain(host string) (string, bool)
- type ConnectionLimitConfig
- type InvalidSandboxPortError
- type InvalidTrafficAccessTokenError
- type MaxConnectionAttempts
- type MissingHeaderError
- type MissingTrafficAccessTokenError
- type Proxy
- func (p *Proxy) CurrentPoolConnections() int64
- func (p *Proxy) CurrentPoolSize() int
- func (p *Proxy) CurrentServerConnections() int64
- func (p *Proxy) ListenAndServe(ctx context.Context) error
- func (p *Proxy) RemoveFromPool(connectionKey string) error
- func (p *Proxy) Serve(l net.Listener) error
- func (p *Proxy) TotalPoolConnections() uint64
- type SandboxNotFoundError
- type SandboxResourceExhaustedError
- type SandboxResumePermissionDeniedError
- type SandboxStillTransitioningError
Constants ¶
View Source
const ( ClientProxyRetries = 1 SandboxProxyRetries = 5 )
Variables ¶
View Source
var ( ErrInvalidHost = errors.New("invalid url host") ErrInvalidSandboxID = errors.New("invalid sandbox ID") )
Functions ¶
func GetTargetFromRequest ¶
func SandboxSharedHostDomain ¶
Types ¶
type ConnectionLimitConfig ¶
type ConnectionLimitConfig struct {
Limiter *connlimit.ConnectionLimiter
GetMaxLimit func(ctx context.Context) int
OnConnectionAcquired func(ctx context.Context, count int64)
OnConnectionReleased func(ctx context.Context, durationMs int64)
OnConnectionBlocked func(ctx context.Context)
}
ConnectionLimitConfig bundles connection limiting and associated metric callbacks. When nil is passed, connection limiting is disabled.
type InvalidSandboxPortError ¶
type InvalidSandboxPortError struct {
Port string
// contains filtered or unexported fields
}
func (InvalidSandboxPortError) Error ¶
func (e InvalidSandboxPortError) Error() string
func (InvalidSandboxPortError) Unwrap ¶
func (e InvalidSandboxPortError) Unwrap() error
type InvalidTrafficAccessTokenError ¶
func NewErrInvalidTrafficAccessToken ¶
func NewErrInvalidTrafficAccessToken(sandboxId string, header string) *InvalidTrafficAccessTokenError
func (InvalidTrafficAccessTokenError) Error ¶
func (e InvalidTrafficAccessTokenError) Error() string
type MaxConnectionAttempts ¶
type MaxConnectionAttempts int
type MissingHeaderError ¶
type MissingHeaderError struct {
Header string
}
func (MissingHeaderError) Error ¶
func (e MissingHeaderError) Error() string
type MissingTrafficAccessTokenError ¶
func NewErrMissingTrafficAccessToken ¶
func NewErrMissingTrafficAccessToken(sandboxId, header string) *MissingTrafficAccessTokenError
func (MissingTrafficAccessTokenError) Error ¶
func (e MissingTrafficAccessTokenError) Error() string
type Proxy ¶
func New ¶
func New( port uint16, maxConnectionAttempts MaxConnectionAttempts, idleTimeout time.Duration, getDestination func(r *http.Request) (*pool.Destination, error), connLimitConfig *ConnectionLimitConfig, disableKeepAlives bool, ) *Proxy
func (*Proxy) CurrentPoolConnections ¶
func (*Proxy) CurrentPoolSize ¶
func (*Proxy) CurrentServerConnections ¶
CurrentServerConnections returns the current number of connections that are alive across whole pool.
func (*Proxy) RemoveFromPool ¶
func (*Proxy) TotalPoolConnections ¶
TotalPoolConnections returns the total number of connections that have been established across whole pool.
type SandboxNotFoundError ¶
type SandboxNotFoundError struct {
SandboxId string
}
func NewErrSandboxNotFound ¶
func NewErrSandboxNotFound(sandboxId string) *SandboxNotFoundError
func (SandboxNotFoundError) Error ¶
func (e SandboxNotFoundError) Error() string
type SandboxResourceExhaustedError ¶
func NewErrSandboxResourceExhausted ¶
func NewErrSandboxResourceExhausted(sandboxId string, message string) *SandboxResourceExhaustedError
func (SandboxResourceExhaustedError) Error ¶
func (e SandboxResourceExhaustedError) Error() string
type SandboxResumePermissionDeniedError ¶
type SandboxResumePermissionDeniedError struct {
SandboxId string
}
func NewErrSandboxResumePermissionDenied ¶
func NewErrSandboxResumePermissionDenied(sandboxId string) *SandboxResumePermissionDeniedError
func (SandboxResumePermissionDeniedError) Error ¶
func (e SandboxResumePermissionDeniedError) Error() string
type SandboxStillTransitioningError ¶
type SandboxStillTransitioningError struct {
SandboxId string
}
func NewErrSandboxStillTransitioning ¶
func NewErrSandboxStillTransitioning(sandboxId string) *SandboxStillTransitioningError
func (SandboxStillTransitioningError) Error ¶
func (e SandboxStillTransitioningError) Error() string
Click to show internal directories.
Click to hide internal directories.