Documentation ¶
Index ¶
- Variables
- type CleanupArgs
- type ContainerStatus
- type DeployArgs
- type DeployResult
- type DeploymentStrategy
- type Engine
- func (e *Engine) Cleanup(ctx context.Context, args CleanupArgs) error
- func (e *Engine) Deploy(ctx context.Context, args DeployArgs) (*DeployResult, error)
- func (e *Engine) GetDefaultService() (*GetDefaultServiceResult, error)
- func (e *Engine) Purge(ctx context.Context) error
- func (e *Engine) RunTask(ctx context.Context, args RunTaskArgs) error
- func (e *Engine) Status(ctx context.Context, args StatusArgs) (*StatusResult, error)
- type EngineConfig
- type GetDefaultServiceResult
- type NetworkConfig
- type NetworkMode
- type PathsConfig
- type ProcessCaddyConfig
- type ProcessStatus
- type ProcessStatuses
- type RunTaskArgs
- type ServiceCallbacksConfig
- type ServiceConfig
- type ServiceDefaultsConfig
- type ServiceMountConfig
- type ServiceProcessConfig
- func (spc ServiceProcessConfig) GetImage() (string, bool, error)
- func (spc ServiceProcessConfig) GetMounts() []mount.Mount
- func (spc ServiceProcessConfig) GetNetworkMode() NetworkMode
- func (spc ServiceProcessConfig) GetQuantity() int
- func (spc ServiceProcessConfig) GetShutdownGracePeriod() time.Duration
- func (spc ServiceProcessConfig) GetUser() string
- type ServiceTaskConfig
- type StatusArgs
- type StatusResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMultipleServices = errors.New("multiple services found, no default") ErrNoService = errors.New("no service found") )
Functions ¶
This section is empty.
Types ¶
type CleanupArgs ¶ added in v0.6.4
type CleanupArgs struct {
ServiceName string
}
type ContainerStatus ¶ added in v0.5.2
type DeployArgs ¶ added in v0.3.0
type DeployResult ¶ added in v0.7.2
type DeploymentStrategy ¶ added in v0.7.0
type DeploymentStrategy int
const ( // DefaultStrategy // // Start new replica of process // Wait for that replica to become healthy // Direct traffic towards the new replica // Send SIGTERM to an old replica of process // Repeat until the count of new replicas meets the specified quantity // Clear up any remaining old replicas DefaultStrategy DeploymentStrategy = iota // ReplaceStrategy // // Remove an existing replica of the process from the loadbalancer // Send SIGTERM to the old replica // Wait for it stop, kiling it after X seconds if not stopped. // Start new replica of the process // Wait for it to become healthy // Direct traffic towards the new replica // Repeat until the count of new replicas meets the specified quantity // Clear up any remaining old replicas ReplaceStrategy )
func (DeploymentStrategy) MarshalYAML ¶ added in v0.7.0
func (s DeploymentStrategy) MarshalYAML() (interface{}, error)
func (DeploymentStrategy) String ¶ added in v0.7.0
func (s DeploymentStrategy) String() string
func (*DeploymentStrategy) UnmarshalYAML ¶ added in v0.7.0
func (s *DeploymentStrategy) UnmarshalYAML(unmarshal func(interface{}) error) error
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) Cleanup ¶ added in v0.6.4
func (e *Engine) Cleanup(ctx context.Context, args CleanupArgs) error
func (*Engine) Deploy ¶
func (e *Engine) Deploy(ctx context.Context, args DeployArgs) (*DeployResult, error)
func (*Engine) GetDefaultService ¶ added in v0.7.2
func (e *Engine) GetDefaultService() (*GetDefaultServiceResult, error)
func (*Engine) RunTask ¶ added in v0.3.0
func (e *Engine) RunTask(ctx context.Context, args RunTaskArgs) error
func (*Engine) Status ¶ added in v0.4.0
func (e *Engine) Status( ctx context.Context, args StatusArgs, ) (*StatusResult, error)
type EngineConfig ¶
type EngineConfig struct { Caddy caddy.Config `yaml:"caddy"` Paths PathsConfig `yaml:"paths"` }
func LoadConfig ¶ added in v0.3.0
func LoadConfig(validate *validator.Validate, pathOverride string) (*EngineConfig, error)
type GetDefaultServiceResult ¶ added in v0.7.2
type GetDefaultServiceResult struct {
Name string
}
type NetworkConfig ¶ added in v0.4.5
type NetworkConfig struct {
Mode *NetworkMode `yaml:"mode"`
}
type NetworkMode ¶ added in v0.4.1
type NetworkMode string
var ( NetworkModeDefault NetworkMode = "" NetworkModeHost NetworkMode = "host" )
type PathsConfig ¶
type ProcessCaddyConfig ¶
type ProcessStatus ¶ added in v0.4.0
type ProcessStatus struct { WantReplicas int Containers []ContainerStatus }
type ProcessStatuses ¶ added in v0.5.2
type ProcessStatuses map[string]ProcessStatus
func (ProcessStatuses) OrderedKeys ¶ added in v0.5.2
func (ps ProcessStatuses) OrderedKeys() []string
type RunTaskArgs ¶ added in v0.3.0
type ServiceCallbacksConfig ¶ added in v0.6.0
type ServiceConfig ¶
type ServiceConfig struct { // Name is the unique identifier of the service, usually the name of the // file it has been retrieved from. Name string `yaml:"_"` // Defaults is a series of configuration values to use by default in // configuring process and task containers. Defaults ServiceDefaultsConfig `yaml:"defaults"` // Processes is a map of process name to configuration to deploy as part of // this service. Processes map[string]ServiceProcessConfig `yaml:"processes" validate:"dive"` // Tasks is a map of task names to configuration that are available for // invoking as part of this service. Tasks map[string]ServiceTaskConfig `yaml:"tasks" validate:"dive"` // Callbacks are definitions of Tasks to run when specific events occur, // e.g before a deployment. Callbacks ServiceCallbacksConfig `yaml:"callbacks"` }
func (*ServiceConfig) Validate ¶ added in v0.6.0
func (sc *ServiceConfig) Validate(v *validator.Validate) error
type ServiceDefaultsConfig ¶
type ServiceDefaultsConfig struct { Image string `yaml:"image"` ImageTag string `yaml:"imageTag"` ImagePull *bool `yaml:"imagePull,omitempty"` Env map[string]string `yaml:"env"` Mounts []ServiceMountConfig `yaml:"mounts"` Network NetworkConfig `yaml:"network"` // User allows the default User/Group to be specified for task and // process containers. // // The following formats are valid: // [ user | user:group | uid | uid:gid | user:gid | uid:group ] User string `yaml:"user"` }
type ServiceMountConfig ¶
type ServiceProcessConfig ¶
type ServiceProcessConfig struct { Image string `yaml:"image"` ImageTag string `yaml:"imageTag"` ImagePull *bool `yaml:"imagePull,omitempty"` Command []string `yaml:"command"` Quantity int `yaml:"quantity"` Env map[string]string `yaml:"env"` Mounts []ServiceMountConfig `yaml:"mounts"` Caddy ProcessCaddyConfig `yaml:"caddy"` // Privileged grants all capabilities to the container. Privileged bool `yaml:"privileged"` // User allows the User/Group to be configured for the process container. // // The following formats are valid: // [ user | user:group | uid | uid:gid | user:gid | uid:group ] User string `yaml:"user"` Network NetworkConfig `yaml:"network"` ReadyCheck *ready.Check `yaml:"readyCheck"` // TODO: add validation to constrain this value DeploymentStrategy DeploymentStrategy `yaml:"deploymentStrategy"` ShutdownGracePeriod time.Duration `yaml:"shutdownGracePeriod"` // contains filtered or unexported fields }
func (ServiceProcessConfig) GetImage ¶ added in v0.6.3
func (spc ServiceProcessConfig) GetImage() (string, bool, error)
func (ServiceProcessConfig) GetMounts ¶ added in v0.6.3
func (spc ServiceProcessConfig) GetMounts() []mount.Mount
func (ServiceProcessConfig) GetNetworkMode ¶ added in v0.6.4
func (spc ServiceProcessConfig) GetNetworkMode() NetworkMode
func (ServiceProcessConfig) GetQuantity ¶ added in v0.4.5
func (spc ServiceProcessConfig) GetQuantity() int
func (ServiceProcessConfig) GetShutdownGracePeriod ¶ added in v0.7.2
func (spc ServiceProcessConfig) GetShutdownGracePeriod() time.Duration
func (ServiceProcessConfig) GetUser ¶ added in v0.6.3
func (spc ServiceProcessConfig) GetUser() string
type ServiceTaskConfig ¶ added in v0.3.0
type ServiceTaskConfig struct { Image string `yaml:"image"` ImageTag string `yaml:"imageTag"` ImagePull *bool `yaml:"imagePull,omitempty"` Command []string `yaml:"command"` Interactive bool `yaml:"interactive"` Env map[string]string `yaml:"env"` Mounts []ServiceMountConfig `yaml:"mounts"` Network NetworkConfig `yaml:"network"` // User allows the User/Group to be configured for the task container. // // The following formats are valid: // [ user | user:group | uid | uid:gid | user:gid | uid:group ] User string `yaml:"user"` // contains filtered or unexported fields }
func (ServiceTaskConfig) GetImage ¶ added in v0.6.3
func (stc ServiceTaskConfig) GetImage() (string, bool, error)
func (ServiceTaskConfig) GetMounts ¶ added in v0.6.3
func (stc ServiceTaskConfig) GetMounts() []mount.Mount
func (ServiceTaskConfig) GetNetworkMode ¶ added in v0.6.4
func (stc ServiceTaskConfig) GetNetworkMode() NetworkMode
func (ServiceTaskConfig) GetUser ¶ added in v0.6.3
func (stc ServiceTaskConfig) GetUser() string
type StatusArgs ¶ added in v0.4.0
type StatusArgs struct {
ServiceName string
}
type StatusResult ¶ added in v0.7.2
type StatusResult struct { DeploymentID int LastDeployedAt time.Time Processes ProcessStatuses }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.