github.com/sagernet/sing@v0.4.0-beta.19.0.20240518125136-f67a0988a636/service/pause/manager.go (about) 1 package pause 2 3 import "github.com/sagernet/sing/common/x/list" 4 5 type Manager interface { 6 DevicePause() 7 DeviceWake() 8 NetworkPause() 9 NetworkWake() 10 IsDevicePaused() bool 11 IsNetworkPaused() bool 12 IsPaused() bool 13 WaitActive() 14 RegisterCallback(callback Callback) *list.Element[Callback] 15 UnregisterCallback(element *list.Element[Callback]) 16 } 17 18 const ( 19 EventDevicePaused int = iota 20 EventDeviceWake 21 EventNetworkPause 22 EventNetworkWake 23 ) 24 25 type Callback = func(event int)