Documentation ¶
Index ¶
- func ApplyUpdates(txn *memdb.Txn, m *model.Root) error
- func ExpandEnv(m *model.Root) error
- type AutoStartMode
- type Config
- func (c *Config) GetGrpcServer() *Server
- func (c *Config) GetHttpServer() *Server
- func (c *Config) GetProcess(name string) *Process
- func (c *Config) LoadPath(configFile string) (memdb.Changes, error)
- func (c *Config) LoadString(s string) (memdb.Changes, error)
- func (c *Config) ProcessNames() []string
- func (c *Config) Processes() Processes
- type Environment
- type File
- type FileSystemWriter
- type Group
- type LocalFile
- type OptionFn
- type Process
- type ProcessByPriority
- type ProcessGroup
- func (pg *ProcessGroup) Add(group, procName string)
- func (pg *ProcessGroup) Clone() *ProcessGroup
- func (pg *ProcessGroup) ForEachProcess(procFunc func(group, procName string))
- func (pg *ProcessGroup) GetAllGroup() []string
- func (pg *ProcessGroup) GetAllProcess(group string) []string
- func (pg *ProcessGroup) GetGroup(procName, defGroup string) string
- func (pg *ProcessGroup) InGroup(procName, group string) bool
- func (pg *ProcessGroup) Remove(procName string)
- func (pg *ProcessGroup) String() string
- func (pg *ProcessGroup) Sub(other *ProcessGroup) (added, changed, removed []string)
- type ProcessSorter
- type Processes
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyUpdates ¶
Types ¶
type AutoStartMode ¶
type AutoStartMode int
const ( AutoStartModeDefault AutoStartMode = iota AutoStartModeAlways AutoStartModeNever )
type Config ¶
type Config struct { Environment *Environment ProgramGroup *ProcessGroup // contains filtered or unexported fields }
Config memory representations of supervisor configuration file
func (*Config) GetGrpcServer ¶
func (*Config) GetHttpServer ¶
func (*Config) GetProcess ¶
func (*Config) LoadString ¶
func (*Config) ProcessNames ¶
type Environment ¶
type FileSystemWriter ¶
type FileSystemWriter struct { RootDir string Files []*File // contains filtered or unexported fields }
func NewFileSystemWriter ¶
func NewFileSystemWriter(fs afero.Fs, opts ...OptionFn) *FileSystemWriter
type Process ¶
type Process struct { Group string Name string Directory string Command string Environment map[string]string User string ExitCodes []int Priority int RestartPause time.Duration StartRetries int StartSeconds time.Duration Cron string AutoStart bool AutoRestart AutoStartMode RestartDirectoryMonitor string RestartFilePattern string RestartWhenBinaryChanged bool StopSignals []string StopWaitSeconds time.Duration StopAsGroup bool KillAsGroup bool StdoutLogFile string StdoutLogfileBackups int StdoutLogFileMaxBytes int RedirectStderr bool StderrLogFile string StderrLogfileBackups int StderrLogFileMaxBytes int DependsOn []string Labels map[string]string }
func (*Process) CronSchedule ¶
func (p *Process) CronSchedule() cron.Schedule
type ProcessByPriority ¶
type ProcessByPriority []*Process
func (ProcessByPriority) Len ¶
func (p ProcessByPriority) Len() int
func (ProcessByPriority) Less ¶
func (p ProcessByPriority) Less(i, j int) bool
func (ProcessByPriority) Swap ¶
func (p ProcessByPriority) Swap(i, j int)
type ProcessGroup ¶
type ProcessGroup struct {
// contains filtered or unexported fields
}
ProcessGroup manage the program and its group mapping
func NewProcessGroup ¶
func NewProcessGroup() *ProcessGroup
NewProcessGroup create a ProcessGroup object
func (*ProcessGroup) Add ¶
func (pg *ProcessGroup) Add(group, procName string)
Add add a process to a group
func (*ProcessGroup) Clone ¶
func (pg *ProcessGroup) Clone() *ProcessGroup
Clone clone the process group
func (*ProcessGroup) ForEachProcess ¶
func (pg *ProcessGroup) ForEachProcess(procFunc func(group, procName string))
ForEachProcess iterate all the processes and process it with procFunc
func (*ProcessGroup) GetAllGroup ¶
func (pg *ProcessGroup) GetAllGroup() []string
GetAllGroup get all the groups
func (*ProcessGroup) GetAllProcess ¶
func (pg *ProcessGroup) GetAllProcess(group string) []string
GetAllProcess get all the processes in a group
func (*ProcessGroup) GetGroup ¶
func (pg *ProcessGroup) GetGroup(procName, defGroup string) string
GetGroup get the group name of process. If fail to find the group by procName, set its group to defGroup and return this defGroup
func (*ProcessGroup) InGroup ¶
func (pg *ProcessGroup) InGroup(procName, group string) bool
InGroup check if a process belongs to a group or not
func (*ProcessGroup) Remove ¶
func (pg *ProcessGroup) Remove(procName string)
Remove remove a process
func (*ProcessGroup) String ¶
func (pg *ProcessGroup) String() string
String convert the process and its group mapping to human readable string
func (*ProcessGroup) Sub ¶
func (pg *ProcessGroup) Sub(other *ProcessGroup) (added, changed, removed []string)
Sub remove all the programs in other ProcessGroup from this ProcessGroup
type ProcessSorter ¶
type ProcessSorter struct {
// contains filtered or unexported fields
}
ProcessSorter sort the program by its priority
func (*ProcessSorter) Sort ¶
func (p *ProcessSorter) Sort(processes []*Process) []*Process
Sort the processes and return the result