Documentation ¶
Overview ¶
Package upstream upstream backends
Index ¶
Constants ¶
View Source
const ( HT_REMOTE_IP = iota + 1 HT_REMOTE_PORT HT_NONE )
View Source
const (
TT_STATIC = iota + 1
)
Variables ¶
This section is empty.
Functions ¶
func AutoUpdatePeer ¶
AutoUpdatePeer is a helper function that will update the list of dynamic upstream peers at a regular rate defined by the parameter seconds.
Types ¶
type IDynamicUpstreamSource ¶
type Upstream ¶
type Upstream struct { Config *config.Upstream Targets []string TargetType uint8 RRcounter uint IsDynamic bool HashType uint8 HashCache *cache.CacheManager DynamicSource IDynamicUpstreamSource DynamicSourceLock sync.Mutex }
func MustNewUpstream ¶
MustNewUpstream does the same thing as NewUpstream and will panic if the creation fails
func NewUpstream ¶
NewUpstream parses an upstream configuration block and creates an Upstream object
func (*Upstream) GetPeer ¶
GetPeer will fetch a peer either from the cache or the peers list upon request
func (*Upstream) GetRRPeer ¶
GetRRPeer will get a peer from the peers list with a round-robin behavior
func (*Upstream) UpdateDynamicPeers ¶
func (m *Upstream) UpdateDynamicPeers()
UpdateDynamicPeers will update the peers of a dynamic upstream
Click to show internal directories.
Click to hide internal directories.