types

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RestartPolicyAlways              = "always"
	RestartPolicyOnFailureDeprecated = "on-failure"
	RestartPolicyOnFailure           = "on_failure"
	RestartPolicyExitOnFailure       = "exit_on_failure"
	RestartPolicyNo                  = "no"
)
View Source
const (
	ProcessStateDisabled    = "Disabled"
	ProcessStatePending     = "Pending"
	ProcessStateRunning     = "Running"
	ProcessStateLaunching   = "Launching"
	ProcessStateLaunched    = "Launched"
	ProcessStateRestarting  = "Restarting"
	ProcessStateTerminating = "Terminating"
	ProcessStateCompleted   = "Completed"
	ProcessStateError       = "Error"
)
View Source
const (
	ProcessHealthReady    = "Ready"
	ProcessHealthNotReady = "Not Ready"
	ProcessHealthUnknown  = "N/A"
)
View Source
const (
	// ProcessConditionCompleted is the type for waiting until a process has completed (any exit code).
	ProcessConditionCompleted = "process_completed"

	// ProcessConditionCompletedSuccessfully is the type for waiting until a process has completed successfully (exit code 0).
	ProcessConditionCompletedSuccessfully = "process_completed_successfully"

	// ProcessConditionHealthy is the type for waiting until a process is healthy.
	ProcessConditionHealthy = "process_healthy"

	// ProcessConditionStarted is the type for waiting until a process has started (default).
	ProcessConditionStarted = "process_started"
)
View Source
const DefaultNamespace = "default"

Variables

This section is empty.

Functions

This section is empty.

Types

type DependsOnConfig

type DependsOnConfig map[string]ProcessDependency

type DeprecationParams

type DeprecationParams struct {
	StartTime time.Time
}

type Environment

type Environment []string

type ProcessConfig

type ProcessConfig struct {
	Name              string
	Disabled          bool                   `yaml:"disabled,omitempty"`
	IsDaemon          bool                   `yaml:"is_daemon,omitempty"`
	Command           string                 `yaml:"command"`
	LogLocation       string                 `yaml:"log_location,omitempty"`
	Environment       Environment            `yaml:"environment,omitempty"`
	RestartPolicy     RestartPolicyConfig    `yaml:"availability,omitempty"`
	DependsOn         DependsOnConfig        `yaml:"depends_on,omitempty"`
	LivenessProbe     *health.Probe          `yaml:"liveness_probe,omitempty"`
	ReadinessProbe    *health.Probe          `yaml:"readiness_probe,omitempty"`
	ShutDownParams    ShutDownParams         `yaml:"shutdown,omitempty"`
	DisableAnsiColors bool                   `yaml:"disable_ansi_colors,omitempty"`
	WorkingDir        string                 `yaml:"working_dir"`
	Namespace         string                 `yaml:"namespace"`
	Replicas          int                    `yaml:"replicas"`
	Extensions        map[string]interface{} `yaml:",inline"`
	ReplicaNum        int
	ReplicaName       string
}

func (*ProcessConfig) CalculateReplicaName added in v0.55.0

func (p *ProcessConfig) CalculateReplicaName() string

func (*ProcessConfig) GetDependencies

func (p *ProcessConfig) GetDependencies() []string

type ProcessDependency

type ProcessDependency struct {
	Condition  string                 `yaml:",omitempty"`
	Extensions map[string]interface{} `yaml:",inline"`
}

type ProcessFunc

type ProcessFunc func(process ProcessConfig) error

type ProcessPorts added in v0.55.0

type ProcessPorts struct {
	Name     string   `json:"name"`
	TcpPorts []uint16 `json:"tcp_ports"`
	UdpPorts []uint16 `json:"udp_ports"`
}

type ProcessState

type ProcessState struct {
	Name       string        `json:"name"`
	Namespace  string        `json:"namespace"`
	Status     string        `json:"status"`
	SystemTime string        `json:"system_time"`
	Age        time.Duration `json:"age"`
	Health     string        `json:"is_ready"`
	Restarts   int           `json:"restarts"`
	ExitCode   int           `json:"exit_code"`
	Pid        int           `json:"pid"`
	IsRunning  bool
}

func NewProcessState added in v0.55.0

func NewProcessState(proc *ProcessConfig) *ProcessState

type Processes

type Processes map[string]ProcessConfig

type ProcessesState added in v0.50.0

type ProcessesState struct {
	States []ProcessState `json:"data"`
}

type Project

type Project struct {
	Version     string               `yaml:"version"`
	LogLocation string               `yaml:"log_location,omitempty"`
	LogLevel    string               `yaml:"log_level,omitempty"`
	LogLength   int                  `yaml:"log_length,omitempty"`
	Processes   Processes            `yaml:"processes"`
	Environment Environment          `yaml:"environment,omitempty"`
	ShellConfig *command.ShellConfig `yaml:"shell,omitempty"`
}

func (*Project) GetDependenciesOrderNames

func (p *Project) GetDependenciesOrderNames() ([]string, error)

func (*Project) GetLexicographicProcessNames

func (p *Project) GetLexicographicProcessNames() ([]string, error)

func (*Project) Validate

func (p *Project) Validate()

func (*Project) ValidateAfterMerge added in v0.55.0

func (p *Project) ValidateAfterMerge() error

func (*Project) WithProcesses

func (p *Project) WithProcesses(names []string, fn ProcessFunc) error

WithProcesses run ProcesseFunc on each Process and dependencies in dependency order

type RestartPolicyConfig

type RestartPolicyConfig struct {
	Restart        string `yaml:",omitempty"`
	BackoffSeconds int    `yaml:"backoff_seconds,omitempty"`
	MaxRestarts    int    `yaml:"max_restarts,omitempty"`
}

type ShutDownParams

type ShutDownParams struct {
	ShutDownCommand string `yaml:"command,omitempty"`
	ShutDownTimeout int    `yaml:"timeout_seconds,omitempty"`
	Signal          int    `yaml:"signal,omitempty"`
}

Jump to

Keyboard shortcuts

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