Documentation ¶
Index ¶
- Constants
- func BuildEncodedAuthConfig(basicAuthB64 string, dockerImage string) (string, error)
- func CalculateReplicas(status string, currentReplicas uint64, maxReplicas uint64) uint64
- func MakeAlertHandler(sq ServiceQuery) http.HandlerFunc
- func MakeAsyncReport(metrics metrics.MetricOptions) http.HandlerFunc
- func MakeDeleteFunctionHandler(metricsOptions metrics.MetricOptions, c *client.Client) http.HandlerFunc
- func MakeForwardingProxyHandler(proxy *httputil.ReverseProxy, metrics *metrics.MetricOptions) http.HandlerFunc
- func MakeFunctionReader(metricsOptions metrics.MetricOptions, c *client.Client) http.HandlerFunc
- func MakeNewFunctionHandler(metricsOptions metrics.MetricOptions, c *client.Client, maxRestarts uint64, ...) http.HandlerFunc
- func MakeProxy(metrics metrics.MetricOptions, wildcard bool, client *client.Client, ...) http.HandlerFunc
- func MakeQueuedProxy(metrics metrics.MetricOptions, wildcard bool, logger *logrus.Logger, ...) http.HandlerFunc
- func MakeUpdateFunctionHandler(metricsOptions metrics.MetricOptions, c *client.Client, maxRestarts uint64, ...) http.HandlerFunc
- type ServiceQuery
- type SwarmServiceQuery
Constants ¶
const DefaultMaxReplicas = 20
DefaultMaxReplicas is the amount of replicas a service will auto-scale up to.
Variables ¶
This section is empty.
Functions ¶
func BuildEncodedAuthConfig ¶
BuildEncodedAuthConfig for private registry
func CalculateReplicas ¶
CalculateReplicas decides what replica count to set depending on current/desired amount
func MakeAlertHandler ¶
func MakeAlertHandler(sq ServiceQuery) http.HandlerFunc
MakeAlertHandler handles alerts from Prometheus Alertmanager
func MakeAsyncReport ¶
func MakeAsyncReport(metrics metrics.MetricOptions) http.HandlerFunc
MakeAsyncReport makes a handler for asynchronous invocations to report back into.
func MakeDeleteFunctionHandler ¶
func MakeDeleteFunctionHandler(metricsOptions metrics.MetricOptions, c *client.Client) http.HandlerFunc
func MakeForwardingProxyHandler ¶
func MakeForwardingProxyHandler(proxy *httputil.ReverseProxy, metrics *metrics.MetricOptions) http.HandlerFunc
MakeForwardingProxyHandler create a handler which forwards HTTP requests
func MakeFunctionReader ¶
func MakeFunctionReader(metricsOptions metrics.MetricOptions, c *client.Client) http.HandlerFunc
MakeFunctionReader gives a summary of Function structs with Docker service stats overlaid with Prometheus counters.
func MakeNewFunctionHandler ¶
func MakeNewFunctionHandler(metricsOptions metrics.MetricOptions, c *client.Client, maxRestarts uint64, restartDelay time.Duration) http.HandlerFunc
MakeNewFunctionHandler creates a new function (service) inside the swarm network.
func MakeProxy ¶
func MakeProxy(metrics metrics.MetricOptions, wildcard bool, client *client.Client, logger *logrus.Logger) http.HandlerFunc
MakeProxy creates a proxy for HTTP web requests which can be routed to a function.
func MakeQueuedProxy ¶
func MakeQueuedProxy(metrics metrics.MetricOptions, wildcard bool, logger *logrus.Logger, canQueueRequests queue.CanQueueRequests) http.HandlerFunc
MakeQueuedProxy accepts work onto a queue
func MakeUpdateFunctionHandler ¶
func MakeUpdateFunctionHandler(metricsOptions metrics.MetricOptions, c *client.Client, maxRestarts uint64, restartDelay time.Duration) http.HandlerFunc
MakeUpdateFunctionHandler request to update an existing function with new configuration such as image, envvars etc.
Types ¶
type ServiceQuery ¶
type ServiceQuery interface { GetReplicas(service string) (currentReplicas uint64, maxReplicas uint64, err error) SetReplicas(service string, count uint64) error }
func NewSwarmServiceQuery ¶
func NewSwarmServiceQuery(c *client.Client) ServiceQuery
NewSwarmServiceQuery create new Docker Swarm implementation
type SwarmServiceQuery ¶
type SwarmServiceQuery struct {
// contains filtered or unexported fields
}
SwarmServiceQuery Docker Swarm implementation
func (SwarmServiceQuery) GetReplicas ¶
func (s SwarmServiceQuery) GetReplicas(serviceName string) (uint64, uint64, error)
GetReplicas replica count for function
func (SwarmServiceQuery) SetReplicas ¶
func (s SwarmServiceQuery) SetReplicas(serviceName string, count uint64) error
SetReplicas update the replica count