power

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWolBridge = "zos"
	PowerServerPort  = 8039
)

Variables

View Source
var (
	ErrFlagNotFound = fmt.Errorf("flag not found")
)

Functions

func EnsureWakeOnLan

func EnsureWakeOnLan(ctx context.Context) (bool, error)

func SetWol

func SetWol(ctx context.Context, nic string, mode WolMode) error

func ValueOfFlag

func ValueOfFlag(ctx context.Context, nic string, flag Flag) (string, error)

Types

type Flag

type Flag string
const (
	SupportsWakeOn Flag = "Supports Wake-on"
	WakeOn         Flag = "Wake-on"
)

type PowerServer

type PowerServer struct {
	// contains filtered or unexported fields
}

func NewPowerServer

func NewPowerServer(
	substrateGateway *stubs.SubstrateGatewayStub,
	consumer *events.RedisConsumer,
	enabled bool,
	farm pkg.FarmID,
	node uint32,
	twin uint32,
	ut *Uptime) (*PowerServer, error)

func (*PowerServer) Start

func (p *PowerServer) Start(ctx context.Context) error

type Uptime

type Uptime struct {
	// Mark is set to done after the first uptime is sent
	Mark utils.Mark
	// contains filtered or unexported fields
}

func NewUptime

func NewUptime(substrateGateway *stubs.SubstrateGatewayStub, id substrate.Identity) (*Uptime, error)

func (*Uptime) SendNow

func (u *Uptime) SendNow() (types.Hash, error)

func (*Uptime) Start

func (u *Uptime) Start(ctx context.Context)

start uptime reporting. returns a channel that is closed immediately after the first uptime is reported.

type WolMode

type WolMode string
const (
	MagicPacket WolMode = "g"
)

Jump to

Keyboard shortcuts

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