Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCookieMismatch = errors.New("client cookie returned from server invalid")
View Source
var ErrNoRefreshCacheDuringRefetch = fmt.Errorf("unnecessary to refresh cache during refetch")
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct { ServerStrategy ServerStrategy Servers []*ServerConfig MaxIdleTime time.Duration Attempts int RetryWait time.Duration LogFailures bool RequireCookie bool AllowOnlyFromPrivate bool CacheMaxTTL int CacheMinTTL int CacheNoReplyTTL int CacheStaleEntryKeepPeriod time.Duration CacheReturnStalePeriod time.Duration CurrentTime func() time.Time RecordMinTTL uint32 RecordMaxTTL uint32 OpportunisticCacheMinHits uint64 OpportunisticCacheMaxTimeLeft time.Duration // contains filtered or unexported fields }
func New ¶
func New(servers []*ServerConfig) *Generator
func (*Generator) FlushCache ¶
func (r *Generator) FlushCache()
func (*Generator) SetCacheSize ¶
type ServerConfig ¶
type ServerStrategy ¶
type ServerStrategy int
const ( StrategyRoundRobin ServerStrategy = iota StrategyRandom StrategyFailover )
Click to show internal directories.
Click to hide internal directories.