sing/service/pause/manager.go
2023-12-24 08:03:42 +08:00

25 lines
471 B
Go

package pause
import "github.com/sagernet/sing/common/x/list"
type Manager interface {
DevicePause()
DeviceWake()
NetworkPause()
NetworkWake()
IsDevicePaused() bool
IsNetworkPaused() bool
IsPaused() bool
WaitActive()
RegisterCallback(callback Callback) *list.Element[Callback]
UnregisterCallback(element *list.Element[Callback])
}
const (
EventDevicePaused int = iota
EventDeviceWake
EventNetworkPause
EventNetworkWake
)
type Callback = func(event int)