Documentation ¶
Index ¶
- Constants
- Variables
- func CleanUpSignals()
- func DisableSignalHandler(name string)
- func FilePath(file string) (real string, err error)
- func RegisterCommand(cmd cli.Command)
- func RegisterSignalHandler(name string, handler SignalHandler, priority int)
- func Run() error
- func RunSignal()
- func SetupConfig(s *config.Setting)
- func SetupUpdate(src string)
- func UseCommand(cmd ...string)
- type App
- type SignalHandler
Constants ¶
View Source
const (
PIPEEMTPY = "_PIPE_EMPTY"
)
Input From Pipe/HereDoc
Variables ¶
View Source
var EnvPrefix string
Functions ¶
func CleanUpSignals ¶
func CleanUpSignals()
CleanUpSignals runs all enabled handlers in priority order
func DisableSignalHandler ¶
func DisableSignalHandler(name string)
DisableSignalHandler can Disable SignalHandler by name
func RegisterCommand ¶
RegisterCommand add new Available command
func RegisterSignalHandler ¶
func RegisterSignalHandler(name string, handler SignalHandler, priority int)
RegisterSignalHandler will add @handler to signal callback list
@name: mark for the handler @handler: callback, returns error. @priority: all Handlers will run in priority order. - `0` has a higher Priority over `1`.
func RunSignal ¶
func RunSignal()
RunSignal will subscribe to SIGINT and SIGKILL and do CleanUp if triggered
func SetupUpdate ¶
func SetupUpdate(src string)
SetupUpdate will add an `update` command, to update self from a http url
Types ¶
type SignalHandler ¶
type SignalHandler func() error
SignalHandler is handler for SIGINT and SIGKILL
Click to show internal directories.
Click to hide internal directories.