Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInfoLogger ¶
NewInfoLogger returns an instance of info-level logger.
Types ¶
type Config ¶
type Config struct { Units []*Unit `json:"units,omitempty"` // contains filtered or unexported fields }
Config is a configuration of Manager.
type Manager ¶
type Manager struct { Services []*Service `json:"services,omitempty"` // contains filtered or unexported fields }
Manager manages services.
func NewManager ¶
NewManager parses config and creates Manager instance.
type Service ¶
type Service struct { Seq int `json:"seq,omitempty"` Unit *Unit `json:"unit,omitempty"` Status *Status `json:"status,omitempty"` State *State `json:"state,omitempty"` Kind WorkerKind `json:"kind,omitempty"` // contains filtered or unexported fields }
Service represents an application instance.
func NewService ¶
NewService creates Service instance.
type State ¶
type State struct { Current StateKind `json:"current,omitempty"` ServiceName string `json:"service_name,omitempty"` Error error `json:"error,omitempty"` }
State represent the last recorded state of a service.
type Status ¶
type Status struct { Current StatusKind `json:"current,omitempty"` ServiceName string `json:"service_name,omitempty"` Error error `json:"error,omitempty"` }
Status represent the last recorded status of a service.
func NewStatus ¶
func NewStatus(name string, kind StatusKind) *Status
NewStatus creates Status instance.
type StatusKind ¶
type StatusKind int
const ( UnknownStatus StatusKind = iota PendingStatus FailureStatus SuccessStatus )
func (StatusKind) EnumIndex ¶
func (k StatusKind) EnumIndex() int
func (StatusKind) MarshalJSON ¶
func (k StatusKind) MarshalJSON() ([]byte, error)
func (StatusKind) String ¶
func (k StatusKind) String() string
type Unit ¶
type Unit struct { // The order of the unit in Config. Seq int `json:"seq,omitempty"` // The alias for the Unit. Name string `json:"name,omitempty"` // The description of the Unit. Description string `json:"description,omitempty"` // The type of the Unit: app, command. Kind string `json:"kind,omitempty"` // The command to execute. Command string `json:"cmd,omitempty"` // The executed command arguments. Arguments []string `json:"args,omitempty"` // The directory the command starts in. WorkDirectory string `json:"workdir,omitempty"` // The higher the Priority the sooner this unit activates. The Manager // activates units with the same Priority in alphabetical order. Priority uint64 `json:"priority,omitempty"` // If set to true, the unit will not be started or stopped. Noop bool `json:"noop,omitempty"` // Not implemented. Wants []string `json:"wants,omitempty"` // Not implemented. Requires []string `json:"requires,omitempty"` // The names of the Units that need to start after this one. Before []string `json:"before,omitempty"` // The names of the Units that need to start prior to this one. After []string `json:"after,omitempty"` // The path to standard output file. StdOutFilePath string `json:"std_out_file_path,omitempty"` // The path to err output file. StdErrFilePath string `json:"std_err_file_path,omitempty"` }
Unit is a configuration for a command or app.
type WorkerKind ¶
type WorkerKind int
func (WorkerKind) EnumIndex ¶
func (k WorkerKind) EnumIndex() int
func (WorkerKind) MarshalJSON ¶
func (k WorkerKind) MarshalJSON() ([]byte, error)
func (WorkerKind) String ¶
func (k WorkerKind) String() string
Click to show internal directories.
Click to hide internal directories.