Documentation
¶
Index ¶
- func Debug() bool
- type DeploySecretOptions
- type DeployServiceOptions
- type GetSecretOptions
- type LabelSet
- type ListSecretsOptions
- type ListServicesOptions
- type Platform
- type PortConfig
- type PrepareEnvironmentOptions
- type ScaleServiceOptions
- type SecretInfo
- type SecretPlatform
- type ServiceInfo
- type ServicePlatform
- type TeardownEnvironmentOptions
- type UndeploySecretOptions
- type UndeployServiceOptions
- type VolumeConfig
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 ¶
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 ¶
GetSecretOptions contains the options for the GetSecret call
type ListSecretsOptions ¶
ListSecretsOptions contains the options for the ListSecrets call
type ListServicesOptions ¶
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
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 ¶
ScaleServiceOptions are the options for the ScaleService call
type SecretInfo ¶
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 ¶
UndeploySecretOptions contains the options for the UndeploySecret call
type UndeployServiceOptions ¶
UndeployServiceOptions contains the options for the UndeployService call
type VolumeConfig ¶
VolumeConfig specifies a volume