Documentation ¶
Index ¶
- Constants
- func BuildEncodedAuthConfig(basicAuthB64 string, dockerImage string) (string, error)
- func DeleteHandler(c *client.Client) http.HandlerFunc
- func DeployHandler(c *client.Client, maxRestarts uint64, restartDelay time.Duration) http.HandlerFunc
- func FunctionProxy(wildcard bool, client *client.Client) http.HandlerFunc
- func FunctionReader(wildcard bool, c client.ServiceAPIClient) http.HandlerFunc
- func GetContentType(request http.Header, proxyResponse http.Header, defaultValue string) string
- func Health() http.HandlerFunc
- func ParseMemory(value string) (int64, error)
- func ReplicaReader(c *client.Client) http.HandlerFunc
- func ReplicaUpdater(c *client.Client) http.HandlerFunc
- func UpdateHandler(c *client.Client, maxRestarts uint64, restartDelay time.Duration) http.HandlerFunc
- type ScaleServiceRequest
- type ServiceQuery
- type SwarmServiceQuery
Constants ¶
const DefaultMaxReplicas = 20
DefaultMaxReplicas is the amount of replicas a service will auto-scale up to.
const MaxScaleLabel = "com.openfaas.scale.max"
MaxScaleLabel label indicating max scale for a function
const MinScaleLabel = "com.openfaas.scale.min"
MinScaleLabel label indicating min scale for a function
Variables ¶
This section is empty.
Functions ¶
func BuildEncodedAuthConfig ¶
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 ¶
GetContentType resolves the correct Content-Tyoe for a proxied function
func Health ¶
func Health() http.HandlerFunc
func ParseMemory ¶
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 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 ¶
GetReplicas replica count for function
func (SwarmServiceQuery) SetReplicas ¶
func (s SwarmServiceQuery) SetReplicas(serviceName string, count uint64) error
SetReplicas update the replica count