deployment

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug added in v0.3.0

func Debug() bool

Debug returns true if the environment variable BTRFAAS_DEBUG is set to "true" this can be evaluated by Platform implementations to help debugging in fact currently this is only evaluated by the docker platform and turns off auto-deletion of failed functions. This is useful if your function service will not even start and you need to look at the logs of your failed container.

Types

type DeploySecretOptions

type DeploySecretOptions struct {
	EnvironmentID string
	ID            string
	Labels        LabelSet
	Value         []byte
}

DeploySecretOptions contains the options for the DeploySecret call

type DeployServiceOptions

type DeployServiceOptions struct {
	EnvironmentID string
	ID            string
	Image         string
	Labels        LabelSet
	Cmd           []string
	Ports         []*PortConfig
	Env           LabelSet // Environment variables: key -> val mapping
	Secrets       LabelSet // Secrets: secret-id -> target-path mapping
	Volumes       []*VolumeConfig
}

DeployServiceOptions contains the options for the DeployService call

type GetSecretOptions

type GetSecretOptions struct {
	EnvironmentID string
	ID            string
}

GetSecretOptions contains the options for the GetSecret call

type LabelSet

type LabelSet map[string]string

LabelSet is a set of key-value pairs (string-string)

type ListSecretsOptions

type ListSecretsOptions struct {
	EnvironmentID string
	Labels        LabelSet
}

ListSecretsOptions contains the options for the ListSecrets call

type ListServicesOptions

type ListServicesOptions struct {
	EnvironmentID string
	Labels        LabelSet
}

ListServicesOptions contains the options for the ListServices call

type Platform

type Platform interface {
	// PrepareEnvironment prepares an environment to start deploying services
	// This should contain all one time setup like creating namespaces/networks etc.
	PrepareEnvironment(ctx context.Context, options *PrepareEnvironmentOptions) error

	// TeardownEnvironment cleans the environment completely
	TeardownEnvironment(ctx context.Context, options *TeardownEnvironmentOptions) error

	ServicePlatform
	SecretPlatform
}

Platform is the interface for all deloyable platforms think about: * swarm * k8s

type PortConfig added in v0.3.0

type PortConfig struct {
	Type      string
	Container uint16
	Host      uint16
}

PortConfig configures available ports of a service container if Type == "cluster" HostPort is ignored if Type == "host" HostPort is used

type PrepareEnvironmentOptions

type PrepareEnvironmentOptions struct {
	ID string
}

PrepareEnvironmentOptions contains the options for the PrepareEnvironment call

type ScaleServiceOptions

type ScaleServiceOptions struct {
	EnvironmentID string
	ID            string
	Scale         uint64
}

ScaleServiceOptions are the options for the ScaleService call

type SecretInfo

type SecretInfo struct {
	ID     string
	Labels LabelSet
}

SecretInfo is the (inner) response type for ListSecrets calls

type SecretPlatform added in v0.2.0

type SecretPlatform interface {
	// DeploySecret deploys a secret in an environment
	DeploySecret(ctx context.Context, options *DeploySecretOptions) error

	// UndeploySecret unddeploys a secret from an environment
	UndeploySecret(ctx context.Context, options *UndeploySecretOptions) error

	// GetSecret returns the secret value
	GetSecret(ctx context.Context, options *GetSecretOptions) ([]byte, error)

	// ListSecrets returns a list of all deployed secrets
	ListSecrets(ctx context.Context, options *ListSecretsOptions) ([]*SecretInfo, error)
}

SecretPlatform provides an interface for service operations

type ServiceInfo

type ServiceInfo struct {
	ID        string
	Image     string
	Labels    LabelSet
	Cmd       []string
	Env       LabelSet // Environment variables: key -> val mapping
	Secrets   LabelSet // Secrets: secret-id -> target-path mapping
	CreatedAt time.Time
	Endpoint  string
	Scale     uint64
}

ServiceInfo contains infos about a running service

type ServicePlatform added in v0.2.0

type ServicePlatform interface {
	// DeployService deploys a service in an environment
	DeployService(ctx context.Context, options *DeployServiceOptions) error

	// UndeployService unddeploys a service from an environment
	UndeployService(ctx context.Context, options *UndeployServiceOptions) error

	// ListServices returns a list of all deployed services
	ListServices(ctx context.Context, options *ListServicesOptions) ([]*ServiceInfo, error)

	// ScaleService scales the service
	ScaleService(ctx context.Context, options *ScaleServiceOptions) error
}

ServicePlatform provides an interface for service operations

type TeardownEnvironmentOptions

type TeardownEnvironmentOptions struct {
	ID string
}

TeardownEnvironmentOptions contains the options for the TeardownEnvironment call

type UndeploySecretOptions

type UndeploySecretOptions struct {
	EnvironmentID string
	ID            string
}

UndeploySecretOptions contains the options for the UndeploySecret call

type UndeployServiceOptions

type UndeployServiceOptions struct {
	EnvironmentID string
	ID            string
}

UndeployServiceOptions contains the options for the UndeployService call

type VolumeConfig

type VolumeConfig struct {
	Type   string
	Source string
	Target string
}

VolumeConfig specifies a volume

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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