Documentation ¶
Index ¶
- Constants
- func PoolsMatch(p1, p2 *Pool) bool
- type Counter
- type Endpoint
- type EndpointIterator
- type EndpointOpts
- type LeastConnection
- type Pool
- func (p *Pool) ContextPath() string
- func (p *Pool) Each(f func(endpoint *Endpoint))
- func (p *Pool) EndpointFailed(endpoint *Endpoint, err error)
- func (p *Pool) Endpoints(defaultLoadBalance, initial string) EndpointIterator
- func (p *Pool) Host() string
- func (p *Pool) IsEmpty() bool
- func (p *Pool) IsOverloaded() bool
- func (p *Pool) MarkUpdated(t time.Time)
- func (p *Pool) MarshalJSON() ([]byte, error)
- func (p *Pool) MaxConnsPerBackend() int64
- func (p *Pool) PruneEndpoints() []*Endpoint
- func (p *Pool) Put(endpoint *Endpoint) PoolPutResult
- func (p *Pool) Remove(endpoint *Endpoint) bool
- func (p *Pool) RouteServiceUrl() string
- type PoolOpts
- type PoolPutResult
- type ProxyRoundTripper
- type RoundRobin
- type Stats
- type Uri
Constants ¶
View Source
const ( UNMODIFIED = PoolPutResult(iota) UPDATED ADDED )
Variables ¶
This section is empty.
Functions ¶
func PoolsMatch ¶
Types ¶
type Endpoint ¶
type Endpoint struct { sync.RWMutex ApplicationId string Tags map[string]string ServerCertDomainSAN string PrivateInstanceId string StaleThreshold time.Duration RouteServiceUrl string PrivateInstanceIndex string ModificationTag models.ModificationTag Stats *Stats IsolationSegment string RoundTripper ProxyRoundTripper UpdatedAt time.Time // contains filtered or unexported fields }
func NewEndpoint ¶
func NewEndpoint(opts *EndpointOpts) *Endpoint
func (*Endpoint) CanonicalAddr ¶
func (*Endpoint) MarshalJSON ¶
type EndpointIterator ¶
type EndpointIterator interface { Next() *Endpoint EndpointFailed(err error) PreRequest(e *Endpoint) PostRequest(e *Endpoint) }
func NewLeastConnection ¶
func NewLeastConnection(p *Pool, initial string) EndpointIterator
func NewRoundRobin ¶
func NewRoundRobin(p *Pool, initial string) EndpointIterator
type EndpointOpts ¶
type EndpointOpts struct { AppId string Host string Port uint16 ServerCertDomainSAN string PrivateInstanceId string PrivateInstanceIndex string Tags map[string]string StaleThresholdInSeconds int RouteServiceUrl string ModificationTag models.ModificationTag IsolationSegment string UseTLS bool UpdatedAt time.Time }
type LeastConnection ¶
type LeastConnection struct {
// contains filtered or unexported fields
}
func (*LeastConnection) EndpointFailed ¶
func (r *LeastConnection) EndpointFailed(err error)
func (*LeastConnection) Next ¶
func (r *LeastConnection) Next() *Endpoint
func (*LeastConnection) PostRequest ¶
func (r *LeastConnection) PostRequest(e *Endpoint)
func (*LeastConnection) PreRequest ¶
func (r *LeastConnection) PreRequest(e *Endpoint)
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) ContextPath ¶
func (*Pool) EndpointFailed ¶
func (*Pool) Endpoints ¶
func (p *Pool) Endpoints(defaultLoadBalance, initial string) EndpointIterator
func (*Pool) IsOverloaded ¶
func (*Pool) MarkUpdated ¶
func (*Pool) MarshalJSON ¶
func (*Pool) MaxConnsPerBackend ¶
func (*Pool) PruneEndpoints ¶
func (*Pool) Put ¶
func (p *Pool) Put(endpoint *Endpoint) PoolPutResult
Returns true if endpoint was added or updated, false otherwise
func (*Pool) RouteServiceUrl ¶
type PoolPutResult ¶
type PoolPutResult int
type ProxyRoundTripper ¶
type ProxyRoundTripper interface { http.RoundTripper CancelRequest(*http.Request) }
type RoundRobin ¶
type RoundRobin struct {
// contains filtered or unexported fields
}
func (*RoundRobin) EndpointFailed ¶
func (r *RoundRobin) EndpointFailed(err error)
func (*RoundRobin) Next ¶
func (r *RoundRobin) Next() *Endpoint
func (*RoundRobin) PostRequest ¶
func (r *RoundRobin) PostRequest(e *Endpoint)
func (*RoundRobin) PreRequest ¶
func (r *RoundRobin) PreRequest(e *Endpoint)
Click to show internal directories.
Click to hide internal directories.