events

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKey

func NewKey() interface{}

func Notify

func Notify(event Event)

Notify 通知事件

func On

func On(event Event, callback func())

On 增加事件回调

func OnClose added in v1.2.1

func OnClose(callback func())

func OnEvents added in v1.2.6

func OnEvents(events []Event, callback func())

func OnKey

func OnKey(event Event, key interface{}, callback func())

OnKey 使用Key增加事件回调

func Remove

func Remove(key interface{})

Remove 删除事件回调

Types

type Callbacks

type Callbacks = []func()

type Event

type Event = string
const (
	EventStart             Event = "start"             // start loading
	EventLoaded            Event = "loaded"            // first load
	EventQuit              Event = "quit"              // quit node gracefully
	EventReload            Event = "reload"            // reload config
	EventTerminated        Event = "terminated"        // process terminated
	EventNFTablesReady     Event = "nftablesReady"     // nftables ready
	EventReloadSomeServers Event = "reloadSomeServers" // reload some servers
)

Jump to

Keyboard shortcuts

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