Documentation
¶
Index ¶
- Constants
- Variables
- func ReapZombie()
- type Errors
- type Supervisor
- func (s *Supervisor) GetManager() *process.Manager
- func (s *Supervisor) GetProcessInfo(_ context.Context, _ *empty.Empty) (*rpc.ProcessInfoResponse, error)
- func (s *Supervisor) GetSupervisorID() string
- func (s *Supervisor) GetVersion(_ context.Context, _ *empty.Empty) (*rpc.VersionResponse, error)
- func (s *Supervisor) IsRestarting() bool
- func (s *Supervisor) Reload() error
- func (s *Supervisor) ReloadConfig(context.Context, *empty.Empty) (*rpc.ReloadConfigResponse, error)
- func (s *Supervisor) RestartProcess(_ context.Context, req *rpc.StartStopRequest) (*rpc.StartStopResponse, error)
- func (s *Supervisor) Shutdown(context.Context, *empty.Empty) (*empty.Empty, error)
- func (s *Supervisor) SignalAllProcesses(_ context.Context, req *rpc.SignalProcessRequest) (*rpc.ProcessInfoResponse, error)
- func (s *Supervisor) SignalProcess(_ context.Context, req *rpc.SignalProcessRequest) (*empty.Empty, error)
- func (s *Supervisor) SignalProcessGroup(_ context.Context, req *rpc.SignalProcessRequest) (*rpc.ProcessInfoResponse, error)
- func (s *Supervisor) StartAllProcesses(_ context.Context, req *rpc.StartStopAllRequest) (*rpc.ProcessInfoResponse, error)
- func (s *Supervisor) StartProcess(_ context.Context, req *rpc.StartStopRequest) (*rpc.StartStopResponse, error)
- func (s *Supervisor) StopAllProcesses(_ context.Context, req *rpc.StartStopAllRequest) (*rpc.ProcessInfoResponse, error)
- func (s *Supervisor) StopProcess(_ context.Context, req *rpc.StartStopRequest) (*rpc.StartStopResponse, error)
- func (s *Supervisor) TailLog(req *rpc.TailLogRequest, stream rpc.Gopm_TailLogServer) error
- func (s *Supervisor) WaitForExit()
- type SupervisorConfigError
- type SupervisorWebgui
Constants ¶
const (
// Version the version of gopm
Version = "1.0"
)
Variables ¶
var HTTP http.FileSystem = http.Dir("./webgui")
HTTP auto generated
Functions ¶
Types ¶
type Supervisor ¶
type Supervisor struct { rpc.UnimplementedGopmServer // contains filtered or unexported fields }
Supervisor manage all the processes defined in the supervisor configuration file. All the supervisor public interface is defined in this class
func NewSupervisor ¶
func NewSupervisor(configFile string) *Supervisor
NewSupervisor create a Supervisor object with supervisor configuration file
func (*Supervisor) GetManager ¶
func (s *Supervisor) GetManager() *process.Manager
GetManager get the Manager object created by superisor
func (*Supervisor) GetProcessInfo ¶
func (s *Supervisor) GetProcessInfo(_ context.Context, _ *empty.Empty) (*rpc.ProcessInfoResponse, error)
func (*Supervisor) GetSupervisorID ¶
func (s *Supervisor) GetSupervisorID() string
GetSupervisorID get the supervisor identifier from configuration file
func (*Supervisor) GetVersion ¶
func (s *Supervisor) GetVersion(_ context.Context, _ *empty.Empty) (*rpc.VersionResponse, error)
func (*Supervisor) IsRestarting ¶
func (s *Supervisor) IsRestarting() bool
IsRestarting check if supervisor is in restarting state
func (*Supervisor) Reload ¶
func (s *Supervisor) Reload() error
Reload reloads the supervisor configuration
func (*Supervisor) ReloadConfig ¶
func (s *Supervisor) ReloadConfig(context.Context, *empty.Empty) (*rpc.ReloadConfigResponse, error)
func (*Supervisor) RestartProcess ¶
func (s *Supervisor) RestartProcess(_ context.Context, req *rpc.StartStopRequest) (*rpc.StartStopResponse, error)
func (*Supervisor) SignalAllProcesses ¶
func (s *Supervisor) SignalAllProcesses(_ context.Context, req *rpc.SignalProcessRequest) (*rpc.ProcessInfoResponse, error)
func (*Supervisor) SignalProcess ¶
func (s *Supervisor) SignalProcess(_ context.Context, req *rpc.SignalProcessRequest) (*empty.Empty, error)
func (*Supervisor) SignalProcessGroup ¶
func (s *Supervisor) SignalProcessGroup(_ context.Context, req *rpc.SignalProcessRequest) (*rpc.ProcessInfoResponse, error)
func (*Supervisor) StartAllProcesses ¶
func (s *Supervisor) StartAllProcesses(_ context.Context, req *rpc.StartStopAllRequest) (*rpc.ProcessInfoResponse, error)
func (*Supervisor) StartProcess ¶
func (s *Supervisor) StartProcess(_ context.Context, req *rpc.StartStopRequest) (*rpc.StartStopResponse, error)
func (*Supervisor) StopAllProcesses ¶
func (s *Supervisor) StopAllProcesses(_ context.Context, req *rpc.StartStopAllRequest) (*rpc.ProcessInfoResponse, error)
func (*Supervisor) StopProcess ¶
func (s *Supervisor) StopProcess(_ context.Context, req *rpc.StartStopRequest) (*rpc.StartStopResponse, error)
func (*Supervisor) TailLog ¶
func (s *Supervisor) TailLog(req *rpc.TailLogRequest, stream rpc.Gopm_TailLogServer) error
func (*Supervisor) WaitForExit ¶
func (s *Supervisor) WaitForExit()
WaitForExit wait the supervisor to exit
type SupervisorConfigError ¶
type SupervisorConfigError struct {
Err error
}
SupervisorConfigError is returned when there was a problem loading the supervisor configuration file.
func (SupervisorConfigError) Error ¶
func (sc SupervisorConfigError) Error() string
func (SupervisorConfigError) Unwrap ¶
func (sc SupervisorConfigError) Unwrap() error
type SupervisorWebgui ¶
type SupervisorWebgui struct {
// contains filtered or unexported fields
}
SupervisorWebgui the interface to show a WEBGUI to control the supervisor
func NewSupervisorWebgui ¶
func NewSupervisorWebgui(supervisor *Supervisor) *SupervisorWebgui
NewSupervisorWebgui create a new SupervisorWebgui object
func (*SupervisorWebgui) CreateHandler ¶
func (sw *SupervisorWebgui) CreateHandler() http.Handler
CreateHandler create a http handler to process the request from WEBGUI