Documentation ¶
Index ¶
- Constants
- func Main(s StartFunc, fs ...interface{})
- func PrintUsage()
- type AnyHandlerFunc
- type Config
- type Context
- func (c *Context) Command(cmd string) (err error)
- func (c *Context) Errorf(pat string, args ...interface{}) error
- func (c *Context) IsDown() bool
- func (c *Context) IsRunning() bool
- func (c *Context) Kill() error
- func (c *Context) Launch() (err error)
- func (c *Context) Logf(pat string, args ...interface{})
- func (c *Context) Stop() error
- type ExitHandlerFunc
- type PanicHandlerFunc
- type ReturnHandlerFunc
- type SignalHandlerFunc
- type StartFunc
- type StatusHandlerFunc
Constants ¶
View Source
const ( MARK_KEY = "_DEEMON_PROC_TYPE_" MARK_CHILD = "CHILD" MARK_WATCHDOG = "WATCHDOG" MARK_STARTER = "STARTER" DefaultMaxKillRetry = 10 //TODO: make this one portable. BSD it is SIGINFO under linux SIGQUIT is considerable. INFOSIGNAL = syscall.SIGQUIT )
Variables ¶
This section is empty.
Functions ¶
func Main ¶
func Main(s StartFunc, fs ...interface{})
Main is a convenience function to be called directly from the main function. It assumes the command as the first argument.pa
func PrintUsage ¶
func PrintUsage()
Types ¶
type AnyHandlerFunc ¶
type Context ¶
type Context struct { Config UseWatchdog bool MaxKillRetry int OnExit ExitHandlerFunc OnPanic PanicHandlerFunc OnSignal SignalHandlerFunc OnReturn ReturnHandlerFunc OnAny AnyHandlerFunc OnStatus StatusHandlerFunc DefaultOnExit ExitHandlerFunc DefaultOnPanic PanicHandlerFunc DefaultOnSignal SignalHandlerFunc DefaultOnReturn ReturnHandlerFunc DefaultOnAny AnyHandlerFunc DefaultOnStatus StatusHandlerFunc Start StartFunc Name string MustRun time.Duration // contains filtered or unexported fields }
func NewContext ¶
type ExitHandlerFunc ¶
type ExitHandlerFunc func(*os.ProcessState) error
type PanicHandlerFunc ¶
type PanicHandlerFunc func(interface{}) error
type ReturnHandlerFunc ¶
type SignalHandlerFunc ¶
type StartFunc ¶
type StartFunc func() error
The loop is only restarted if none of the Handler implementations return an error != nil.
type StatusHandlerFunc ¶
type StatusHandlerFunc func() string
Click to show internal directories.
Click to hide internal directories.