svc

package
v0.0.0-...-47f881f Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSignals = []os.Signal{syscall.SIGINT, syscall.SIGTERM}

DefaultSignals default signals to register, and the behavior is to terminate the process

Functions

func Run

func Run(svc Service) error

Run start the service and handle signals

func Signal

func Signal(s os.Signal, f SignalHandleFunc)

Signal Register a signal handler

Types

type Service

type Service interface {
	Start() error
	Stop() error
}

Service interface for Run argument

type SignalHandleFunc

type SignalHandleFunc func(os.Signal) bool

SignalHandleFunc signal handle function

Jump to

Keyboard shortcuts

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