Documentation
¶
Index ¶
- Constants
- func EmitEvent(event Event)
- func RegisterEventListener(eventListenerName string, events []string, listener *EventListener)
- type BaseEvent
- type Event
- type EventListener
- type EventListenerManager
- type EventPoolSerial
- type ProcCommEvent
- type ProcCommEventCapture
- type ProcessGroupEvent
- type ProcessLogEvent
- type ProcessStateEvent
- func CreateProcessBackoffEvent(process string, group string, fromState string, tries int) *ProcessStateEvent
- func CreateProcessExitedEvent(process string, group string, fromState string, expected int, pid int) *ProcessStateEvent
- func CreateProcessFatalEvent(process string, group string, fromState string) *ProcessStateEvent
- func CreateProcessRunningEvent(process string, group string, fromState string, pid int) *ProcessStateEvent
- func CreateProcessStartingEvent(process string, group string, fromState string, tries int) *ProcessStateEvent
- func CreateProcessStoppedEvent(process string, group string, fromState string, pid int) *ProcessStateEvent
- func CreateProcessStoppingEvent(process string, group string, fromState string, pid int) *ProcessStateEvent
- func CreateProcessUnknownEvent(process string, group string, fromState string) *ProcessStateEvent
- type RemoteCommunicationEvent
- type SupervisorStateChangeEvent
- type TickEvent
Constants ¶
const ( // EventSysVersion the event system version EventSysVersion = "3.0" // ProcCommonBeginStr the process communication begin ProcCommonBeginStr = "<!--XSUPERVISOR:BEGIN-->" // ProcCommonEndStr the process communication end ProcCommonEndStr = "<!--XSUPERVISOR:END-->" )
Variables ¶
This section is empty.
Functions ¶
func EmitEvent ¶
func EmitEvent(event Event)
EmitEvent emit an event to default event listener manager
func RegisterEventListener ¶
func RegisterEventListener(eventListenerName string, events []string, listener *EventListener)
RegisterEventListener register the event listener to accept the emitted events
Types ¶
type BaseEvent ¶
type BaseEvent struct {
// contains filtered or unexported fields
}
BaseEvent the base event, all other events should inherit this BaseEvent to implement the Event interface
type EventListener ¶
type EventListener struct {
// contains filtered or unexported fields
}
EventListener the event listener object
func NewEventListener ¶
func NewEventListener(pool string, server string, stdin io.Reader, stdout io.Writer, bufferSize int) *EventListener
NewEventListener create a NewEventListener object
func UnregisterEventListener ¶
func UnregisterEventListener(eventListenerName string) *EventListener
UnregisterEventListener unregister the listener by its name
func (*EventListener) HandleEvent ¶
func (el *EventListener) HandleEvent(event Event)
HandleEvent handle the emitted event
type EventListenerManager ¶
type EventListenerManager struct {
// contains filtered or unexported fields
}
EventListenerManager manage the event listeners
func NewEventListenerManager ¶
func NewEventListenerManager() *EventListenerManager
NewEventListenerManager create an EventListenerManager object
func (*EventListenerManager) EmitEvent ¶
func (em *EventListenerManager) EmitEvent(event Event)
EmitEvent emit an event to all the listeners managed by this manager
type EventPoolSerial ¶
EventPoolSerial manage the event serial generation
func NewEventPoolSerial ¶
func NewEventPoolSerial() *EventPoolSerial
NewEventPoolSerial create a new EventPoolSerial object
type ProcCommEvent ¶
type ProcCommEvent struct {
BaseEvent
// contains filtered or unexported fields
}
ProcCommEvent process communication event definition
func NewProcCommEvent ¶
func NewProcCommEvent(eventType string, procName string, groupName string, pid int, data string) *ProcCommEvent
NewProcCommEvent create a new ProcCommEvent object
func (*ProcCommEvent) GetBody ¶
func (p *ProcCommEvent) GetBody() string
GetBody get the process communication event body
type ProcCommEventCapture ¶
type ProcCommEventCapture struct {
// contains filtered or unexported fields
}
ProcCommEventCapture process communication event capture
func NewProcCommEventCapture ¶
func NewProcCommEventCapture(reader io.Reader, captureMaxBytes int, stdType string, procName string, groupName string) *ProcCommEventCapture
NewProcCommEventCapture create a new ProcCommEventCapture object
func (*ProcCommEventCapture) SetPid ¶
func (pec *ProcCommEventCapture) SetPid(pid int)
SetPid set the pid of the program
type ProcessGroupEvent ¶
type ProcessGroupEvent struct {
BaseEvent
// contains filtered or unexported fields
}
ProcessGroupEvent the process group event definition
func CreateProcessGroupAddedEvent ¶
func CreateProcessGroupAddedEvent(groupName string) *ProcessGroupEvent
CreateProcessGroupAddedEvent create process group added event
func CreateProcessGroupRemovedEvent ¶
func CreateProcessGroupRemovedEvent(groupName string) *ProcessGroupEvent
CreateProcessGroupRemovedEvent create process group removed event
func (*ProcessGroupEvent) GetBody ¶
func (pe *ProcessGroupEvent) GetBody() string
GetBody get the body of process group event
type ProcessLogEvent ¶
type ProcessLogEvent struct {
BaseEvent
// contains filtered or unexported fields
}
ProcessLogEvent process log event definition
func CreateProcessLogStderrEvent ¶
func CreateProcessLogStderrEvent(processName string, groupName string, pid int, data string) *ProcessLogEvent
CreateProcessLogStderrEvent create process stderr log event
func CreateProcessLogStdoutEvent ¶
func CreateProcessLogStdoutEvent(processName string, groupName string, pid int, data string) *ProcessLogEvent
CreateProcessLogStdoutEvent create process stdout log event
func (*ProcessLogEvent) GetBody ¶
func (pe *ProcessLogEvent) GetBody() string
GetBody get the body of process log event
type ProcessStateEvent ¶
type ProcessStateEvent struct {
BaseEvent
// contains filtered or unexported fields
}
ProcessStateEvent process state event definition
func CreateProcessBackoffEvent ¶
func CreateProcessBackoffEvent(process string, group string, fromState string, tries int) *ProcessStateEvent
CreateProcessBackoffEvent create process backoff event
func CreateProcessExitedEvent ¶
func CreateProcessExitedEvent(process string, group string, fromState string, expected int, pid int) *ProcessStateEvent
CreateProcessExitedEvent create process exited event
func CreateProcessFatalEvent ¶
func CreateProcessFatalEvent(process string, group string, fromState string) *ProcessStateEvent
CreateProcessFatalEvent create process fatal error event
func CreateProcessRunningEvent ¶
func CreateProcessRunningEvent(process string, group string, fromState string, pid int) *ProcessStateEvent
CreateProcessRunningEvent create a process running event
func CreateProcessStartingEvent ¶
func CreateProcessStartingEvent(process string, group string, fromState string, tries int) *ProcessStateEvent
CreateProcessStartingEvent create a process starting event
func CreateProcessStoppedEvent ¶
func CreateProcessStoppedEvent(process string, group string, fromState string, pid int) *ProcessStateEvent
CreateProcessStoppedEvent create process stopped event
func CreateProcessStoppingEvent ¶
func CreateProcessStoppingEvent(process string, group string, fromState string, pid int) *ProcessStateEvent
CreateProcessStoppingEvent create process stopping event
func CreateProcessUnknownEvent ¶
func CreateProcessUnknownEvent(process string, group string, fromState string) *ProcessStateEvent
CreateProcessUnknownEvent create process state unknown event
func (*ProcessStateEvent) GetBody ¶
func (pse *ProcessStateEvent) GetBody() string
GetBody get the body of process state event
type RemoteCommunicationEvent ¶
type RemoteCommunicationEvent struct {
BaseEvent
// contains filtered or unexported fields
}
RemoteCommunicationEvent remote communication event definition
func NewRemoteCommunicationEvent ¶
func NewRemoteCommunicationEvent(typ string, data string) *RemoteCommunicationEvent
NewRemoteCommunicationEvent create a new RemoteCommunicationEvent object
func (*RemoteCommunicationEvent) GetBody ¶
func (r *RemoteCommunicationEvent) GetBody() string
GetBody get the event body
type SupervisorStateChangeEvent ¶
type SupervisorStateChangeEvent struct {
BaseEvent
}
SupervisorStateChangeEvent supervisor state change event
func CreateSupervisorStateChangeRunning ¶
func CreateSupervisorStateChangeRunning() *SupervisorStateChangeEvent
CreateSupervisorStateChangeRunning create a SupervisorStateChangeEvent object
func (*SupervisorStateChangeEvent) GetBody ¶
func (s *SupervisorStateChangeEvent) GetBody() string
GetBody get the body of supervisor state change event
type TickEvent ¶
type TickEvent struct {
BaseEvent
// contains filtered or unexported fields
}
TickEvent the tick event definition
func NewTickEvent ¶
NewTickEvent create a new periodical TickEvent object