kkdaemon

package module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServiceMap = sync.Map{}
View Source
var StopWhenKill = true

Functions

func RegisterService

func RegisterService(service Service) error

func RegisterServiceInline added in v1.0.2

func RegisterServiceInline(name string, order int, startFunc func(), stopFunc func(sig os.Signal)) error

func Start

func Start()

func Stop

func Stop(sig os.Signal)

Types

type DefaultService

type DefaultService struct {
	ServiceName  string
	ServiceOrder int
}

func (*DefaultService) Info

func (s *DefaultService) Info() string

func (*DefaultService) Name

func (s *DefaultService) Name() string

func (*DefaultService) Order

func (s *DefaultService) Order() int

func (*DefaultService) Restart

func (s *DefaultService) Restart()

func (*DefaultService) Start

func (s *DefaultService) Start()

func (*DefaultService) Stop

func (s *DefaultService) Stop(sig os.Signal)

type PanicResult

type PanicResult struct {
	Service Service
	Caught  kkpanic.Caught
}

type Service

type Service interface {
	Start()
	Stop(sig os.Signal)
	Restart()
	Info() string
	Name() string
	Order() int
}

func GetService

func GetService(name string) Service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL