handlers

package
v0.0.0-...-9f928a6 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2018 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxReplicas = 20

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

View Source
const MaxScaleLabel = "com.openfaas.scale.max"

MaxScaleLabel label indicating max scale for a function

View Source
const MinScaleLabel = "com.openfaas.scale.min"

MinScaleLabel label indicating min scale for a function

Variables

This section is empty.

Functions

func BuildEncodedAuthConfig

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

BuildEncodedAuthConfig for private registry

func DeleteHandler

func DeleteHandler(c *client.Client) http.HandlerFunc

DeleteHandler delete a function

func DeployHandler

func DeployHandler(c *client.Client, maxRestarts uint64, restartDelay time.Duration) http.HandlerFunc

DeployHandler creates a new function (service) inside the swarm network.

func FunctionProxy

func FunctionProxy(wildcard bool, client *client.Client) http.HandlerFunc

FunctionProxy passes-through to functions

func FunctionReader

func FunctionReader(wildcard bool, c client.ServiceAPIClient) http.HandlerFunc

FunctionReader reads functions from Swarm metadata

func GetContentType

func GetContentType(request http.Header, proxyResponse http.Header, defaultValue string) string

GetContentType resolves the correct Content-Tyoe for a proxied function

func Health

func Health() http.HandlerFunc

func ParseMemory

func ParseMemory(value string) (int64, error)

func ReplicaReader

func ReplicaReader(c *client.Client) http.HandlerFunc

ReplicaReader reads replica and image status data from a function

func ReplicaUpdater

func ReplicaUpdater(c *client.Client) http.HandlerFunc

func UpdateHandler

func UpdateHandler(c *client.Client, maxRestarts uint64, restartDelay time.Duration) http.HandlerFunc

UpdateHandler updates an existng function

Types

type ScaleServiceRequest

type ScaleServiceRequest struct {
	ServiceName string `json:"serviceName"`
	Replicas    uint64 `json:"replicas"`
}

type ServiceQuery

type ServiceQuery interface {
	GetReplicas(service string) (currentReplicas uint64, maxReplicas uint64, minReplicas uint64, err error)
	SetReplicas(service string, count uint64) error
}

ServiceQuery provides interface for replica querying/setting

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 implementation for Docker Swarm

func (SwarmServiceQuery) GetReplicas

func (s SwarmServiceQuery) GetReplicas(serviceName string) (uint64, 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