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) GetLogsAndSubscribe(name string, observer pclog.PcLogObserver)
- func (p *Project) GetProcessLog(name string, offsetFromEnd, limit int) ([]string, error)
- func (p *Project) GetProcessLogLength(name string) int
- func (p *Project) GetProcessLogLine(name string, lineIndex int) (string, error)
- func (p *Project) GetProcessState(name string) *ProcessState
- func (p *Project) Run()
- func (p *Project) ShutDownProject()
- func (p *Project) StartProcess(name string) error
- func (p *Project) StopProcess(name string) error
- func (p *Project) UnSubscribeLogger(name string)
- func (p *Project) WithProcesses(names []string, fn ProcessFunc) error
- type RestartPolicyConfig
- type ShutDownParams
Constants ¶
View Source
const ( RestartPolicyAlways = "always" RestartPolicyOnFailure = "on-failure" RestartPolicyNo = "no" )
View Source
const ( ProcessStateDisabled = "Disabled" ProcessStatePending = "Pending" ProcessStateRunning = "Running" ProcessStateRestarting = "Restarting" ProcessStateTerminating = "Terminating" 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" )
View Source
const (
DEFAULT_LOG_LENGTH = 1000
)
View Source
const (
DEFAULT_SHUTDOWN_TIMEOUT_SEC = 10
)
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
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"`
ShutDownParams ShutDownParams `yaml:"shutdown,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"`
LogLength int `yaml:"log_length,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) GetLogsAndSubscribe ¶ added in v0.10.0
func (p *Project) GetLogsAndSubscribe(name string, observer pclog.PcLogObserver)
func (*Project) GetProcessLog ¶
func (*Project) GetProcessLogLength ¶ added in v0.10.0
func (*Project) GetProcessLogLine ¶ added in v0.10.0
func (*Project) GetProcessState ¶
func (p *Project) GetProcessState(name string) *ProcessState
func (*Project) ShutDownProject ¶ added in v0.12.0
func (p *Project) ShutDownProject()
func (*Project) StartProcess ¶
func (*Project) StopProcess ¶
func (*Project) UnSubscribeLogger ¶ added in v0.10.0
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 ShutDownParams ¶ added in v0.11.0
Click to show internal directories.
Click to hide internal directories.