Documentation ¶
Index ¶
- Constants
- Variables
- func Deamonize(proc func())
- func GenTemplate(writer io.Writer) error
- func JsonOutput(data interface{})
- func LoadEnvFile()
- func NewHttpBasicAuth(user string, password string, handler http.Handler) *httpBasicAuth
- func ReapZombie()
- func Run()
- func RunServer()
- type BaseChecker
- type ContentChecker
- type CtlCommand
- type DecodeCommand
- type EncodeCommand
- type GetEnvCommand
- type HttpChecker
- type HttpServeMux
- type InitTemplateCommand
- type LogReadInfo
- type Options
- type PidCommand
- type ProcessLogReadInfo
- type ProcessStdin
- type ProcessTailLog
- type RPCServer
- type ReloadCommand
- type RemoteCommEvent
- type RestartCommand
- type ScriptChecker
- type SetEnvCommand
- type ShutdownCommand
- type SignalCommand
- type StartCommand
- type StartProcessArgs
- type StateInfo
- type StatusCommand
- type StopCommand
- type Supervisor
- func (s *Supervisor) AddProcessGroup(args *struct{ Name string }, reply *rpcclient.StatusReply) error
- func (s *Supervisor) ClearLog(args *struct{}, reply *rpcclient.StatusReply) error
- func (s *Supervisor) GetAllProcessInfo(args *struct{}, reply *rpcclient.AllProcessInfoReply) error
- func (s *Supervisor) GetEnv(args *rpcclient.GetEnvArg, reply *rpcclient.GetEnvRet) error
- func (s *Supervisor) GetPID(args *struct{}, reply *struct{ Pid int }) error
- func (s *Supervisor) GetProcessInfo(args *struct{ Name string }, reply *rpcclient.ProcessInfoReply) error
- func (s *Supervisor) GetState(args *struct{}, reply *struct{ StateInfo StateInfo }) error
- func (s *Supervisor) GetSupervisorVersion(args *rpcclient.GetVersionArg, reply *rpcclient.GetVersionRet) error
- func (s *Supervisor) GetVersion(args *rpcclient.GetVersionArg, reply *rpcclient.GetVersionRet) error
- func (s *Supervisor) ReadLog(args *LogReadInfo, reply *struct{ Log string }) error
- func (s *Supervisor) ReloadConfig(args *rpcclient.ReloadConfigArg, reply *rpcclient.ReloadConfigRet) error
- func (s *Supervisor) RemoveProcessGroup(args *struct{ Name string }, reply *rpcclient.StatusReply) error
- func (s *Supervisor) Restart(args *struct{}, reply *rpcclient.StatusReply) error
- func (s *Supervisor) RestartAllProcesses(args ..., reply *rpcclient.AllProcessInfoReply) error
- func (s *Supervisor) RestartProcess(args *StartProcessArgs, reply *rpcclient.StatusReply) error
- func (s *Supervisor) SendProcessStdin(args *ProcessStdin, reply *rpcclient.StatusReply) error
- func (s *Supervisor) SendRemoteCommEvent(args *RemoteCommEvent, reply *rpcclient.StatusReply) error
- func (s *Supervisor) SetEnv(args *rpcclient.SetEnvArg, reply *rpcclient.SetEnvRet) error
- func (s *Supervisor) Shutdown(args *struct{}, reply *rpcclient.StatusReply) error
- func (s *Supervisor) SignalAllProcesses(args *rpcclient.SignalAllProcessesArg, reply *rpcclient.SignalAllProcessesRet) error
- func (s *Supervisor) SignalProcess(args *types.ProcessSignal, reply *rpcclient.StatusReply) error
- func (s *Supervisor) SignalProcessGroup(args *types.ProcessSignal, reply *rpcclient.AllProcessInfoReply) error
- func (s *Supervisor) StartAllProcesses(args ..., reply *rpcclient.AllProcessInfoReply) error
- func (s *Supervisor) StartProcess(args *StartProcessArgs, reply *rpcclient.StatusReply) error
- func (s *Supervisor) StartProcessGroup(args *StartProcessArgs, reply *rpcclient.AllProcessInfoReply) error
- func (s *Supervisor) StopAllProcesses(args ..., reply *rpcclient.AllProcessInfoReply) error
- func (s *Supervisor) StopProcess(args *StartProcessArgs, reply *rpcclient.StatusReply) error
- func (s *Supervisor) StopProcessGroup(args *StartProcessArgs, reply *rpcclient.AllProcessInfoReply) error
- type SupervisorRestful
- func (sr *SupervisorRestful) CreateProgramHandler() http.Handler
- func (sr *SupervisorRestful) ListProgram(w http.ResponseWriter, req *http.Request)
- func (sr *SupervisorRestful) ReadStdoutLog(w http.ResponseWriter, req *http.Request)
- func (sr *SupervisorRestful) Reload(w http.ResponseWriter, req *http.Request)
- func (sr *SupervisorRestful) Shutdown(w http.ResponseWriter, req *http.Request)
- func (sr *SupervisorRestful) StartProgram(w http.ResponseWriter, req *http.Request)
- func (sr *SupervisorRestful) StartPrograms(w http.ResponseWriter, req *http.Request)
- func (sr *SupervisorRestful) StopProgram(w http.ResponseWriter, req *http.Request)
- func (sr *SupervisorRestful) StopPrograms(w http.ResponseWriter, req *http.Request)
- type TailCommand
- type TcpChecker
- type VersionCommand
Constants ¶
View Source
const (
SUPERVISOR_VERSION = "3.0"
)
View Source
const VERSION = "1.0.8"
Variables ¶
View Source
var (
HttpMux = &HttpServeMux{}
)
Functions ¶
func GenTemplate ¶
func LoadEnvFile ¶
func LoadEnvFile()
func NewHttpBasicAuth ¶
func ReapZombie ¶
func ReapZombie()
Types ¶
type BaseChecker ¶
type BaseChecker struct {
// contains filtered or unexported fields
}
func NewBaseChecker ¶
func NewBaseChecker(includes []string, timeout int) *BaseChecker
func (*BaseChecker) Check ¶
func (bc *BaseChecker) Check() bool
type ContentChecker ¶
type ContentChecker interface {
Check() bool
}
type CtlCommand ¶
type CtlCommand struct { ServerUrl string `short:"s" long:"serverurl" description:"URL on which supervisord server is listening"` User string `short:"u" long:"user" description:"the user name"` Password string `short:"P" long:"password" description:"the password"` Verbose bool `short:"v" long:"verbose" description:"Show verbose debug information"` Encode string `short:"o" long:"output" description:"set output encode for ctl command, value is txt or json, default is txt"` Follow bool `short:"f" long:"follow" description:"The -f option causes tail to not stop when end of file is reached."` }
func (*CtlCommand) Execute ¶
func (x *CtlCommand) Execute(args []string) error
type DecodeCommand ¶
type DecodeCommand struct { Key string `short:"k" long:"key" description:"Auth key input"` Out string `short:"o" long:"out" description:"File ouput"` }
func (DecodeCommand) Execute ¶
func (v DecodeCommand) Execute(args []string) error
type EncodeCommand ¶
type EncodeCommand struct { Key string `short:"k" long:"key" description:"Auth key input"` Out string `short:"o" long:"out" description:"File ouput"` }
func (EncodeCommand) Execute ¶
func (v EncodeCommand) Execute(args []string) error
type GetEnvCommand ¶
type GetEnvCommand struct { }
func (*GetEnvCommand) Execute ¶
func (c *GetEnvCommand) Execute(args []string) error
type HttpChecker ¶
type HttpChecker struct {
// contains filtered or unexported fields
}
func NewHttpChecker ¶
func NewHttpChecker(url string, timeout int) *HttpChecker
func (*HttpChecker) Check ¶
func (hc *HttpChecker) Check() bool
type HttpServeMux ¶
func (*HttpServeMux) ServeHTTP ¶
func (s *HttpServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
type InitTemplateCommand ¶
type InitTemplateCommand struct {
OutFile string `short:"o" long:"output" description:"the output file name" required:"true"`
}
func (*InitTemplateCommand) Execute ¶
func (x *InitTemplateCommand) Execute(args []string) error
type LogReadInfo ¶
type PidCommand ¶
type PidCommand struct { }
func (*PidCommand) Execute ¶
func (c *PidCommand) Execute(args []string) error
type ProcessLogReadInfo ¶
type ProcessStdin ¶
type ProcessTailLog ¶
type RPCServer ¶
type RPCServer struct {
// contains filtered or unexported fields
}
func NewRPCServer ¶
func NewRPCServer(s *Supervisor) *RPCServer
func (*RPCServer) StartInetHttpServer ¶
func (*RPCServer) StartUnixHttpServer ¶
type ReloadCommand ¶
type ReloadCommand struct { }
func (*ReloadCommand) Execute ¶
func (c *ReloadCommand) Execute(args []string) error
type RemoteCommEvent ¶
type RestartCommand ¶
type RestartCommand struct { }
func (*RestartCommand) Execute ¶
func (rc *RestartCommand) Execute(args []string) error
type ScriptChecker ¶
type ScriptChecker struct {
// contains filtered or unexported fields
}
func NewScriptChecker ¶
func NewScriptChecker(args []string) *ScriptChecker
func (*ScriptChecker) Check ¶
func (sc *ScriptChecker) Check() bool
type SetEnvCommand ¶
type SetEnvCommand struct { }
func (*SetEnvCommand) Execute ¶
func (c *SetEnvCommand) Execute(args []string) error
type ShutdownCommand ¶
type ShutdownCommand struct { }
func (*ShutdownCommand) Execute ¶
func (c *ShutdownCommand) Execute(args []string) error
type SignalCommand ¶
type SignalCommand struct { }
func (*SignalCommand) Execute ¶
func (c *SignalCommand) Execute(args []string) error
type StartCommand ¶
type StartCommand struct { }
func (*StartCommand) Execute ¶
func (c *StartCommand) Execute(args []string) error
type StartProcessArgs ¶
type StatusCommand ¶
type StatusCommand struct { }
func (*StatusCommand) Execute ¶
func (c *StatusCommand) Execute(args []string) error
type StopCommand ¶
type StopCommand struct { }
func (*StopCommand) Execute ¶
func (c *StopCommand) Execute(args []string) error
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
func NewSupervisor ¶
func NewSupervisor(configFile string) *Supervisor
func (*Supervisor) AddProcessGroup ¶
func (s *Supervisor) AddProcessGroup(args *struct{ Name string }, reply *rpcclient.StatusReply) error
func (*Supervisor) ClearLog ¶
func (s *Supervisor) ClearLog(args *struct{}, reply *rpcclient.StatusReply) error
func (*Supervisor) GetAllProcessInfo ¶
func (s *Supervisor) GetAllProcessInfo(args *struct{}, reply *rpcclient.AllProcessInfoReply) error
func (*Supervisor) GetPID ¶
func (s *Supervisor) GetPID(args *struct{}, reply *struct{ Pid int }) error
Get all the name of prorams
Return the name of all the programs
func (s *Supervisor) GetPrograms() []string { return s.config.GetProgramNames() }
func (*Supervisor) GetProcessInfo ¶
func (s *Supervisor) GetProcessInfo(args *struct{ Name string }, reply *rpcclient.ProcessInfoReply) error
func (*Supervisor) GetState ¶
func (s *Supervisor) GetState(args *struct{}, reply *struct{ StateInfo StateInfo }) error
func (*Supervisor) GetSupervisorVersion ¶
func (s *Supervisor) GetSupervisorVersion(args *rpcclient.GetVersionArg, reply *rpcclient.GetVersionRet) error
func (*Supervisor) GetVersion ¶
func (s *Supervisor) GetVersion(args *rpcclient.GetVersionArg, reply *rpcclient.GetVersionRet) error
func (*Supervisor) ReadLog ¶
func (s *Supervisor) ReadLog(args *LogReadInfo, reply *struct{ Log string }) error
func (*Supervisor) ReloadConfig ¶
func (s *Supervisor) ReloadConfig(args *rpcclient.ReloadConfigArg, reply *rpcclient.ReloadConfigRet) error
func (*Supervisor) RemoveProcessGroup ¶
func (s *Supervisor) RemoveProcessGroup(args *struct{ Name string }, reply *rpcclient.StatusReply) error
func (*Supervisor) Restart ¶
func (s *Supervisor) Restart(args *struct{}, reply *rpcclient.StatusReply) error
func (*Supervisor) RestartAllProcesses ¶
func (s *Supervisor) RestartAllProcesses(args *struct { Wait bool `default:"true"` }, reply *rpcclient.AllProcessInfoReply) error
func (*Supervisor) RestartProcess ¶
func (s *Supervisor) RestartProcess(args *StartProcessArgs, reply *rpcclient.StatusReply) error
func (*Supervisor) SendProcessStdin ¶
func (s *Supervisor) SendProcessStdin(args *ProcessStdin, reply *rpcclient.StatusReply) error
func (*Supervisor) SendRemoteCommEvent ¶
func (s *Supervisor) SendRemoteCommEvent(args *RemoteCommEvent, reply *rpcclient.StatusReply) error
func (*Supervisor) Shutdown ¶
func (s *Supervisor) Shutdown(args *struct{}, reply *rpcclient.StatusReply) error
func (*Supervisor) SignalAllProcesses ¶
func (s *Supervisor) SignalAllProcesses(args *rpcclient.SignalAllProcessesArg, reply *rpcclient.SignalAllProcessesRet) error
func (*Supervisor) SignalProcess ¶
func (s *Supervisor) SignalProcess(args *types.ProcessSignal, reply *rpcclient.StatusReply) error
func (*Supervisor) SignalProcessGroup ¶
func (s *Supervisor) SignalProcessGroup(args *types.ProcessSignal, reply *rpcclient.AllProcessInfoReply) error
func (*Supervisor) StartAllProcesses ¶
func (s *Supervisor) StartAllProcesses(args *struct { Wait bool `default:"true"` }, reply *rpcclient.AllProcessInfoReply) error
func (*Supervisor) StartProcess ¶
func (s *Supervisor) StartProcess(args *StartProcessArgs, reply *rpcclient.StatusReply) error
func (*Supervisor) StartProcessGroup ¶
func (s *Supervisor) StartProcessGroup(args *StartProcessArgs, reply *rpcclient.AllProcessInfoReply) error
func (*Supervisor) StopAllProcesses ¶
func (s *Supervisor) StopAllProcesses(args *struct { Wait bool `default:"true"` }, reply *rpcclient.AllProcessInfoReply) error
func (*Supervisor) StopProcess ¶
func (s *Supervisor) StopProcess(args *StartProcessArgs, reply *rpcclient.StatusReply) error
func (*Supervisor) StopProcessGroup ¶
func (s *Supervisor) StopProcessGroup(args *StartProcessArgs, reply *rpcclient.AllProcessInfoReply) error
type SupervisorRestful ¶
type SupervisorRestful struct {
// contains filtered or unexported fields
}
func NewSupervisorRestful ¶
func NewSupervisorRestful(supervisor *Supervisor) *SupervisorRestful
func (*SupervisorRestful) CreateProgramHandler ¶
func (sr *SupervisorRestful) CreateProgramHandler() http.Handler
func (*SupervisorRestful) ListProgram ¶
func (sr *SupervisorRestful) ListProgram(w http.ResponseWriter, req *http.Request)
list the status of all the programs
json array to present the status of all programs
func (*SupervisorRestful) ReadStdoutLog ¶
func (sr *SupervisorRestful) ReadStdoutLog(w http.ResponseWriter, req *http.Request)
func (*SupervisorRestful) Reload ¶
func (sr *SupervisorRestful) Reload(w http.ResponseWriter, req *http.Request)
func (*SupervisorRestful) Shutdown ¶
func (sr *SupervisorRestful) Shutdown(w http.ResponseWriter, req *http.Request)
func (*SupervisorRestful) StartProgram ¶
func (sr *SupervisorRestful) StartProgram(w http.ResponseWriter, req *http.Request)
func (*SupervisorRestful) StartPrograms ¶
func (sr *SupervisorRestful) StartPrograms(w http.ResponseWriter, req *http.Request)
func (*SupervisorRestful) StopProgram ¶
func (sr *SupervisorRestful) StopProgram(w http.ResponseWriter, req *http.Request)
func (*SupervisorRestful) StopPrograms ¶
func (sr *SupervisorRestful) StopPrograms(w http.ResponseWriter, req *http.Request)
type TailCommand ¶
type TailCommand struct {
Follow bool `short:"f" description:"The -f option causes tail to not stop when end of file is reached."`
}
func (*TailCommand) Execute ¶
func (c *TailCommand) Execute(args []string) error
type TcpChecker ¶
type TcpChecker struct {
// contains filtered or unexported fields
}
func NewTcpChecker ¶
func NewTcpChecker(host string, port int, includes []string, timeout int) *TcpChecker
func (*TcpChecker) Check ¶
func (tc *TcpChecker) Check() bool
type VersionCommand ¶
type VersionCommand struct { }
func (VersionCommand) Execute ¶
func (v VersionCommand) Execute(args []string) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.