-
Notifications
You must be signed in to change notification settings - Fork 1
/
event.go
28 lines (22 loc) · 911 Bytes
/
event.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package lu
import "context"
//go:generate stringer -type=EventType
type OnEvent func(context.Context, Event)
type EventType int
const (
Unknown EventType = iota
AppStartup // First event, emitted right at the start
PreHookStart // Emitted just before running each Hook.Start
PostHookStart // Emitted just after completing a Hook.Start
AppRunning // Emitted after starting every process
ProcessStart // Emitted before starting to run a Process
ProcessEnd // Emitted when a Process terminates
AppTerminating // Emitted when the application starts termination
PreHookStop // Emitted before running each Hook.Stop
PostHookStop // Emitted after running each Hook.Stop
AppTerminated // Emitted before calling os.Exit
)
type Event struct {
Type EventType
Name string
}