modules

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeAsync

func MakeAsync[R any](routine func() R) (func(), chan R)

func Ping

func Ping(addr string) (bool, error)

func Validate

func Validate[T any](input map[string]interface{}, output *T) error

Types

type DefaultModule

type DefaultModule struct{}

func (*DefaultModule) Init

func (*DefaultModule) Init(config map[string]interface{}) error

func (*DefaultModule) PowerOff

func (*DefaultModule) PowerOff() error

func (*DefaultModule) PowerOn

func (*DefaultModule) PowerOn() error

func (*DefaultModule) State

func (*DefaultModule) State() (Result[bool], Result[bool])

type Module

type Module interface {
	Init(config map[string]interface{}) error
	State() (Result[bool], Result[bool])
	PowerOn() error
	PowerOff() error
}

type Result

type Result[T any] struct {
	Value T
	Err   error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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