mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-03 20:07:38 +03:00
25 lines
471 B
Go
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)
|