zdpgo_signal

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 4 Imported by: 0

README

zdpgo_signal

golang开发的信号库,用于实现优雅退出等功能

功能清单

  • 优雅退出

版本历史

  • 2022年2月11日:版本0.1.0 增加优雅退出功能

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExitFunc

type ExitFunc func() // 退出函数

type Signal

type Signal struct {
	// contains filtered or unexported fields
}

func New

func New(config SignalConfig) *Signal

func (*Signal) Exit

func (s *Signal) Exit()

Exit 退出系统

func (*Signal) ExitWithFunc

func (s *Signal) ExitWithFunc(f ExitFunc)

type SignalConfig

type SignalConfig struct {
	Debug       bool   // 是否为debug模式
	LogFilePath string // 日志路径
}

Jump to

Keyboard shortcuts

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