Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FunctionHTTPProber ¶
type FunctionHTTPProber struct { Query scaling.FunctionQuery Resolver middleware.BaseURLResolver DirectFunctions bool }
FunctionHTTPProber probes a function's health endpoint
func (*FunctionHTTPProber) Probe ¶
func (f *FunctionHTTPProber) Probe(functionName, namespace string) FunctionProbeResult
Scale scales a function from zero replicas to 1 or the value set in the minimum replicas metadata
type FunctionNonProber ¶
type FunctionNonProber struct { }
func (*FunctionNonProber) Probe ¶
func (f *FunctionNonProber) Probe(functionName, namespace string) FunctionProbeResult
type FunctionProbeResult ¶
type FunctionProbeResult struct { Available bool Error error Found bool Duration time.Duration Updated time.Time }
FunctionProbeResult holds the result of scaling from zero
type FunctionProber ¶
type FunctionProber interface {
Probe(functionName, namespace string) FunctionProbeResult
}
func NewFunctionProber ¶
func NewFunctionProber(functionQuery scaling.FunctionQuery, resolver middleware.BaseURLResolver) FunctionProber
NewFunctionProber create a new scaler with the specified ScalingConfig
type ProbeCache ¶
type ProbeCache struct { Cache map[string]*FunctionProbeResult Expiry time.Duration Sync sync.RWMutex }
ProbeCache provides a cache of Probe replica counts
func (*ProbeCache) Get ¶
func (fc *ProbeCache) Get(functionName, namespace string) (*FunctionProbeResult, bool)
func (*ProbeCache) Set ¶
func (fc *ProbeCache) Set(functionName, namespace string, result *FunctionProbeResult)
Set replica count for functionName
type ProbeCacher ¶
type ProbeCacher interface { Set(functionName, namespace string, result *FunctionProbeResult) Get(functionName, namespace string) (result *FunctionProbeResult, hit bool) }
ProbeCacher queries functions and caches the results
func NewProbeCache ¶
func NewProbeCache(cacheExpiry time.Duration) ProbeCacher
NewProbeCache creates a function cache to query function metadata
Click to show internal directories.
Click to hide internal directories.