Documentation
¶
Index ¶
- Constants
- Variables
- func IsShutdown() bool
- func RegisterDaemon(order int, daemon Daemon) error
- func RegisterServiceInline(name string, order int, startFunc func(), stopFunc func(sig os.Signal)) error
- func ShutdownDone() concurrent.Future
- func ShutdownGracefully()
- func Start()
- func Stop(sig os.Signal)
- func WaitShutdown()
- type Daemon
- type DaemonEntity
- type DefaultDaemon
- type DefaultTimerDaemon
- type PanicResult
- type TimerDaemon
Constants ¶
View Source
const StateRun = int32(1)
View Source
const StateStop = int32(2)
View Source
const StateWait = int32(0)
Variables ¶
View Source
var AutoStopWhenKill = true
View Source
var DaemonMap = sync.Map{}
Functions ¶
func IsShutdown ¶ added in v1.1.3
func IsShutdown() bool
func RegisterDaemon ¶ added in v1.1.0
func RegisterServiceInline ¶ added in v1.0.2
func ShutdownDone ¶ added in v1.2.18
func ShutdownDone() concurrent.Future
func ShutdownGracefully ¶ added in v1.2.0
func ShutdownGracefully()
func WaitShutdown ¶ added in v1.2.0
func WaitShutdown()
Types ¶
type DaemonEntity ¶ added in v1.1.0
type DaemonEntity struct {
Name string
Daemon Daemon
Order int
// contains filtered or unexported fields
}
func GetService ¶
func GetService(name string) *DaemonEntity
type DefaultDaemon ¶ added in v1.1.0
type DefaultDaemon struct {
Params map[string]interface{}
// contains filtered or unexported fields
}
func (*DefaultDaemon) Name ¶ added in v1.1.6
func (d *DefaultDaemon) Name() string
func (*DefaultDaemon) Registered ¶ added in v1.1.5
func (d *DefaultDaemon) Registered() error
func (*DefaultDaemon) Start ¶ added in v1.1.0
func (d *DefaultDaemon) Start()
func (*DefaultDaemon) State ¶ added in v1.2.18
func (d *DefaultDaemon) State() int32
func (*DefaultDaemon) Stop ¶ added in v1.1.0
func (d *DefaultDaemon) Stop(sig os.Signal)
type DefaultTimerDaemon ¶ added in v1.2.7
type DefaultTimerDaemon struct {
DefaultDaemon
// contains filtered or unexported fields
}
func (*DefaultTimerDaemon) Interval ¶ added in v1.2.18
func (d *DefaultTimerDaemon) Interval() time.Duration
func (*DefaultTimerDaemon) Loop ¶ added in v1.2.7
func (d *DefaultTimerDaemon) Loop() error
type PanicResult ¶
Click to show internal directories.
Click to hide internal directories.