route

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 11 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

func NewCounter

func NewCounter(initial int64) *Counter

func (*Counter) Count

func (c *Counter) Count() int64

func (*Counter) Decrement

func (c *Counter) Decrement()

func (*Counter) Increment

func (c *Counter) Increment()

type Endpoint

type Endpoint struct {
	ApplicationId     string
	Address           string
	Port              uint16
	Tags              map[string]string
	PrivateInstanceId string

	RouteServiceUrl      string
	PrivateInstanceIndex string
	ModificationTag      models.ModificationTag
	Stats                *Stats
	// contains filtered or unexported fields
}

func NewEndpoint

func NewEndpoint(
	appId,
	host string,
	port uint16,
	privateInstanceId string,
	privateInstanceIndex string,
	tags map[string]string,
	staleThresholdInSeconds int,
	routeServiceUrl string,
	modificationTag models.ModificationTag,
) *Endpoint

func (*Endpoint) CanonicalAddr

func (e *Endpoint) CanonicalAddr() string

func (*Endpoint) Component

func (rm *Endpoint) Component() string

func (*Endpoint) MarshalJSON

func (e *Endpoint) MarshalJSON() ([]byte, error)

func (*Endpoint) ToLogData

func (e *Endpoint) ToLogData() []zap.Field

type EndpointIterator

type EndpointIterator interface {
	Next() *Endpoint
	EndpointFailed()
	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 LeastConnection

type LeastConnection struct {
	// contains filtered or unexported fields
}

func (*LeastConnection) EndpointFailed

func (r *LeastConnection) EndpointFailed()

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 NewPool

func NewPool(retryAfterFailure time.Duration, contextPath string) *Pool

func (*Pool) ContextPath

func (p *Pool) ContextPath() string

func (*Pool) Each

func (p *Pool) Each(f func(endpoint *Endpoint))

func (*Pool) Endpoints

func (p *Pool) Endpoints(defaultLoadBalance, initial string) EndpointIterator

func (*Pool) FindById

func (p *Pool) FindById(id string) *Endpoint

func (*Pool) IsEmpty

func (p *Pool) IsEmpty() bool

func (*Pool) MarkUpdated

func (p *Pool) MarkUpdated(t time.Time)

func (*Pool) MarshalJSON

func (p *Pool) MarshalJSON() ([]byte, error)

func (*Pool) PruneEndpoints

func (p *Pool) PruneEndpoints(defaultThreshold time.Duration) []*Endpoint

func (*Pool) Put

func (p *Pool) Put(endpoint *Endpoint) bool

Returns true if endpoint was added or updated, false otherwise

func (*Pool) Remove

func (p *Pool) Remove(endpoint *Endpoint) bool

Returns true if the endpoint was removed from the Pool, false otherwise.

func (*Pool) RouteServiceUrl

func (p *Pool) RouteServiceUrl() string

type RoundRobin

type RoundRobin struct {
	// contains filtered or unexported fields
}

func (*RoundRobin) EndpointFailed

func (r *RoundRobin) EndpointFailed()

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)

type Stats

type Stats struct {
	NumberConnections *Counter
}

func NewStats

func NewStats() *Stats

type Uri

type Uri string

func (Uri) NextWildcard

func (u Uri) NextWildcard() (Uri, error)

func (Uri) RouteKey

func (u Uri) RouteKey() Uri

func (Uri) String

func (u Uri) String() string

func (Uri) ToLower

func (u Uri) ToLower() Uri

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL