handlers

package
v0.0.0-...-88878d6 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2017 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxReplicas = 20

DefaultMaxReplicas is the amount of replicas a service will auto-scale up to.

Variables

This section is empty.

Functions

func BuildEncodedAuthConfig

func BuildEncodedAuthConfig(basicAuthB64 string, dockerImage string) (string, error)

BuildEncodedAuthConfig for private registry

func CalculateReplicas

func CalculateReplicas(status string, currentReplicas uint64, maxReplicas uint64) uint64

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

Jump to

Keyboard shortcuts

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