deployment

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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         map[uint16]uint16 // Host Port -> Container Port
	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 PrepareEnvironmentOptions

type PrepareEnvironmentOptions struct {
	ID string
}

PrepareEnvironmentOptions contains the options for the PrepareEnvironment call

type ScaleServiceOptions

type ScaleServiceOptions struct {
	ServiceID 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