pause

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: GPL-2.0 Imports: 6 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	EventDevicePaused int = iota
	EventDeviceWake
	EventNetworkPause
	EventNetworkWake
)

Variables

This section is empty.

Functions

func ContextWithDefaultManager deprecated

func ContextWithDefaultManager(ctx context.Context) context.Context

Deprecated: use WithDefaultManager instead.

func ContextWithManager deprecated

func ContextWithManager(ctx context.Context, manager Manager) context.Context

Deprecated: use service.ContextWith instead.

func RegisterTicker added in v0.5.3

func RegisterTicker(manager Manager, ticker *time.Ticker, duration time.Duration, resume func()) *list.Element[Callback]

func WithDefaultManager

func WithDefaultManager(ctx context.Context) context.Context

Types

type Callback

type Callback = func(event int)

type Manager

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])
}

func ManagerFromContext deprecated

func ManagerFromContext(ctx context.Context) Manager

Deprecated: use service.ContextWith instead.

Jump to

Keyboard shortcuts

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