Documentation
¶
Index ¶
- Constants
- type Client
- func (c Client) AddProcessGroup(name string) (bool, error)
- func (c Client) ApiVersion() (string, error)
- func (c Client) ClearAllProcessLogs() error
- func (c Client) ClearProcessLogs(name string) error
- func (c Client) Clearlog() error
- func (c Client) GetAllProcessInfo() ([]ProcessInfo, error)
- func (c Client) GetProcessInfo(name string) (*ProcessInfo, error)
- func (c Client) Identification() (string, error)
- func (c Client) Pid() (int64, error)
- func (c Client) ReadLog(offset, length int) (string, error)
- func (c Client) ReadProcessStderr(name string, offset, length int) (string, error)
- func (c Client) ReadProcessStdout(name string, offset, length int) (string, error)
- func (c Client) ReloadConfig() (map[string][]string, error)
- func (c Client) RemoveProcessGroup(name string) (bool, error)
- func (c Client) Restart() error
- func (c Client) SendProcessStdin(name, chars string) error
- func (c Client) SendRemoteCommEvent(t, data string) error
- func (c Client) Shutdown() error
- func (c Client) SignalAllProcesses(signal int) ([]*ProcessInfo, error)
- func (c Client) SignalProcess(name string, signal int) ([]*ProcessInfo, error)
- func (c Client) SignalProcessGroup(name string, signal int) ([]*ProcessInfo, error)
- func (c Client) StartAllProcesses(wait bool) ([]ProcessInfo, error)
- func (c Client) StartProcess(name string, wait bool) (bool, error)
- func (c Client) StartProcessGroup(name string, wait bool) ([]ProcessInfo, error)
- func (c Client) State() (*State, error)
- func (c Client) StopAllProcesses(wait bool) ([]ProcessInfo, error)
- func (c Client) StopProcess(name string, wait bool) (bool, error)
- func (c Client) StopProcessGroup(name string, wait bool) ([]ProcessInfo, error)
- func (c Client) SupervisorVersion() (string, error)
- func (c Client) TailProcessStderr(name string, offset, length int) (string, error)
- func (c Client) TailProcessStdout(name string, offset, length int) (string, error)
- func (c Client) Update() error
- type Event
- type EventMessage
- type HeaderToken
- type Listener
- type ProcessInfo
- type RunCode
- type State
Constants ¶
const ( EVENT_BASE Event = "EVENT" EVENT_PROCESS_STATE = "PROCESS_STATE" EVENT_PROCESS_STATE_STARTING = "PROCESS_STATE_STARTING" EVENT_PROCESS_STATE_RUNNING = "PROCESS_STATE_RUNNING" EVENT_PROCESS_STATE_BACKOFF = "PROCESS_STATE_BACKOFF" EVENT_PROCESS_STATE_STOPPING = "PROCESS_STATE_STOPPING" EVENT_PROCESS_STATE_EXITED = "PROCESS_STATE_EXITED" EVENT_PROCESS_STATE_STOPPED = "PROCESS_STATE_STOPPED" EVENT_PROCESS_STATE_FATAL = "PROCESS_STATE_FATAL" EVENT_PROCESS_STATE_UNKNOWN = "PROCESS_STATE_UNKNOWN" EVENT_REMOTE_COMMUNICATION = "REMOTE_COMMUNICATION" EVENT_PROCESS_LOG = "PROCESS_LOG" EVENT_PROCESS_LOG_STDOUT = "PROCESS_LOG_STDOUT" EVENT_PROCESS_LOG_STDERR = "PROCESS_LOG_STDERR" EVENT_PROCESS_COMMUNICATION = "PROCESS_COMMUNICATION" EVENT_PROCESS_COMMUNICATION_STDOUT = "PROCESS_COMMUNICATION_STDOUT" EVENT_PROCESS_COMMUNICATION_STDERR = "PROCESS_COMMUNICATION_STDERR" EVENT_SUPERVISOR_STATE_CHANGE = "SUPERVISOR_STATE_CHANGE" EVENT_SUPERVISOR_STATE_CHANGE_RUNNING = "SUPERVISOR_STATE_CHANGE_RUNNING" EVENT_SUPERVISOR_STATE_CHANGE_STOPPING = "SUPERVISOR_STATE_CHANGE_STOPPING" EVENT_TICK = "TICK" EVENT_TICK_5 = "TICK_5" EVENT_TICK_60 = "TICK_60" EVENT_TICK_3600 = "TICK_3600" EVENT_PROCESS_GROUP = "PROCESS_GROUP" EVENT_PROCESS_GROUP_ADDED = "PROCESS_GROUP_ADDED " EVENT_PROCESS_GROUP_REMOVED = "PROCESS_GROUP_REMOVED" )
const ( GROUPS_ADDED = "PROCESS_GROUPS_ADDED" GROUPS_CHANGED = "PROCESS_GROUPS_CHANGED" GROUPS_REMOVED = "PROCESS_GROUPS_REMOVED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) AddProcessGroup ¶
Update the config for a running process from the configuration file
func (Client) ApiVersion ¶
Returns the version of the RPC API used by supervisord
func (Client) ClearAllProcessLogs ¶
Clear all process log files
func (Client) ClearProcessLogs ¶
Clear the stdout and stderr logs for the specified process and reopen them
func (Client) GetAllProcessInfo ¶
func (c Client) GetAllProcessInfo() ([]ProcessInfo, error)
Get info about all processes
func (Client) GetProcessInfo ¶
func (c Client) GetProcessInfo(name string) (*ProcessInfo, error)
Get info about a specific process
func (Client) Identification ¶
Result identifying string of supervisord
func (Client) ReadProcessStderr ¶
Read from the stderr for the specified process
func (Client) ReadProcessStdout ¶
Read from the stdout for specified process
func (Client) ReloadConfig ¶
Reload the configuration ( supervisorctl reread )
func (Client) RemoveProcessGroup ¶
Remove a stopped process group from the active configuration
func (Client) SendProcessStdin ¶
Send a string of characters to the STDIN of the specified process
func (Client) SendRemoteCommEvent ¶
Send an event that will be received by any event listener subprocesses subscribing to the 'RemoteCommunicationEvent'
func (Client) SignalAllProcesses ¶
func (c Client) SignalAllProcesses(signal int) ([]*ProcessInfo, error)
Send an arbitrary UNIX signal to all processes listed in the configuration file
func (Client) SignalProcess ¶
func (c Client) SignalProcess(name string, signal int) ([]*ProcessInfo, error)
Send an arbitrary UNIX signal to the process specified
func (Client) SignalProcessGroup ¶
func (c Client) SignalProcessGroup(name string, signal int) ([]*ProcessInfo, error)
Send an arbitrary UNIX signal to all process in the group specified
func (Client) StartAllProcesses ¶
func (c Client) StartAllProcesses(wait bool) ([]ProcessInfo, error)
Start all processes listed in the configuration file
func (Client) StartProcess ¶
Start a process
func (Client) StartProcessGroup ¶
func (c Client) StartProcessGroup(name string, wait bool) ([]ProcessInfo, error)
Start all processes listed in the group specified
func (Client) StopAllProcesses ¶
func (c Client) StopAllProcesses(wait bool) ([]ProcessInfo, error)
Stop all processes listed in the configuration file
func (Client) StopProcess ¶
Stop a process
func (Client) StopProcessGroup ¶
func (c Client) StopProcessGroup(name string, wait bool) ([]ProcessInfo, error)
Stop all processes listed in the group specified
func (Client) SupervisorVersion ¶
Return the version of the supervisor package in use by supervisord
func (Client) TailProcessStderr ¶
Provides a more efficient way to tail the stderr log
func (Client) TailProcessStdout ¶
Provides a more efficient way to tail the stdout log
type EventMessage ¶
type EventMessage struct { Headers *HeaderToken Body []byte }
func NewEventMessage ¶
func NewEventMessage(headers *HeaderToken, body []byte) EventMessage
func (EventMessage) AsMap ¶
func (e EventMessage) AsMap() map[string]string
func (EventMessage) String ¶
func (e EventMessage) String() string
type HeaderToken ¶
type HeaderToken struct { Version string `token:"ver"` // The event system protocol version. Server string `token:"server"` // The identifier of the supervisord sending the event. Serial int `token:"serial"` // An integer assigned to each event. Pool string `token:"pool"` // The name of the event listener pool which generated this event. PoolSerial int `token:"poolserial"` // An integer assigned to each event by the eventlistener pool which is being sent from. EventName Event `token:"eventname"` // The specific event type name. Length int `token:"len"` // An integer indicating the number of bytes in the event payload. }
func NewHeaderToken ¶
func NewHeaderToken(header string) (*HeaderToken, error)
type Listener ¶
type Listener struct { Stdin *os.File Stdout *os.File Stderr *os.File // contains filtered or unexported fields }
func NewListener ¶
func NewListener() *Listener
func (*Listener) FilterEvents ¶
filter to specific event types
func (*Listener) FilterProcesses ¶
Filter to specific process names
func (*Listener) Messages ¶
func (l *Listener) Messages() chan EventMessage
type ProcessInfo ¶
type ProcessInfo struct { Name string `xmlrpc:"name"` Group string `xmlrpc:"group"` Description string `xmlrpc:"description"` Start int64 `xmlrpc:"start"` Stop int64 `xmlrpc:"stop"` Now int64 `xmlrpc:"now"` State int64 `xmlrpc:"state"` StateName string `xmlrpc:"statename"` SpawnErr string `xmlrpc:"spawnerr"` ExitStatus int64 `xmlrpc:"exitstatus"` StdoutLogFile string `xmlrpc:"stdout_logfile"` StderrLogFile string `xmlrpc:"stderr_logfile"` Pid int64 `xmlrpc:"pid"` }