Documentation
¶
Index ¶
- Constants
- Variables
- func AutoDiscoverComposeFile(pwd string) (string, error)
- type DependsOnConfig
- type Process
- type ProcessConfig
- type ProcessDependency
- type ProcessFunc
- type ProcessState
- type Processes
- type Project
- func (p *Project) GetDependenciesOrderNames() ([]string, error)
- func (p *Project) GetLexicographicProcessNames() []string
- func (p *Project) GetProcessLog(name string, offsetFromEnd, limit int) ([]string, error)
- func (p *Project) GetProcessState(name string) *ProcessState
- func (p *Project) Run()
- func (p *Project) StartProcess(name string) error
- func (p *Project) StopProcess(name string) error
- func (p *Project) WithProcesses(names []string, fn ProcessFunc) error
- type RestartPolicyConfig
Constants ¶
View Source
const ( RestartPolicyAlways = "always" RestartPolicyOnFailure = "on-failure" RestartPolicyNo = "no" )
View Source
const ( ProcessStateDisabled = "Disabled" ProcessStatePending = "Pending" ProcessStateRunning = "Running" ProcessStateRestarting = "Restarting" ProcessStateCompleted = "Completed" )
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" )
Variables ¶
View Source
var DefaultFileNames = []string{"compose.yml", "compose.yaml", "process-compose.yml", "process-compose.yaml"}
DefaultFileNames defines the Compose file names for auto-discovery (in order of preference)
Functions ¶
func AutoDiscoverComposeFile ¶
Types ¶
type DependsOnConfig ¶
type DependsOnConfig map[string]ProcessDependency
type Process ¶
func NewProcess ¶
func NewProcess( globalEnv []string, logger pclog.PcLogger, procConf ProcessConfig, procState *ProcessState, procLog *pclog.ProcessLogBuffer, replica int) *Process
func (*Process) GetNameWithReplica ¶
func (*Process) WaitForCompletion ¶
type ProcessConfig ¶
type ProcessConfig struct { Name string Disabled bool `yaml:"disabled,omitempty"` Command string `yaml:"command"` LogLocation string `yaml:"log_location,omitempty"` Environment []string `yaml:"environment,omitempty"` RestartPolicy RestartPolicyConfig `yaml:"availability,omitempty"` DependsOn DependsOnConfig `yaml:"depends_on,omitempty"` Extensions map[string]interface{} `yaml:",inline"` }
func (ProcessConfig) GetDependencies ¶
func (p ProcessConfig) GetDependencies() []string
type ProcessDependency ¶
type ProcessFunc ¶
type ProcessFunc func(process ProcessConfig) error
type ProcessState ¶
type Processes ¶
type Processes map[string]ProcessConfig
type Project ¶
type Project struct { Version string `yaml:"version"` LogLocation string `yaml:"log_location,omitempty"` LogLevel string `yaml:"log_level,omitempty"` Processes Processes `yaml:"processes"` Environment []string `yaml:"environment,omitempty"` // contains filtered or unexported fields }
var PROJ *Project
func CreateProject ¶
func (*Project) GetDependenciesOrderNames ¶
func (*Project) GetLexicographicProcessNames ¶
func (*Project) GetProcessLog ¶
func (*Project) GetProcessState ¶
func (p *Project) GetProcessState(name string) *ProcessState
func (*Project) StartProcess ¶
func (*Project) StopProcess ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.