device

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDevice

func AddDevice(deviceKey string, device *Device)

func LoadDevices

func LoadDevices(ctx context.Context) error

func OffAction

func OffAction(ctx context.Context, tunnelId int)

func RemoveDevice

func RemoveDevice(id uint64) error

func StartAction

func StartAction(ctx context.Context, deviceKey string)

Types

type Device

type Device struct {
	model.Device
	events.EventEmitter

	Context map[string]interface{}
	// contains filtered or unexported fields
}

Device 设备

func GetDevice

func GetDevice(id uint64) *Device

func LoadDevice

func LoadDevice(ctx context.Context, key string) (*Device, error)

func NewDevice

func NewDevice(ctx context.Context, m *model.Device) (*Device, error)

func (*Device) Refresh

func (dev *Device) Refresh(ctx context.Context) error

func (*Device) Running

func (dev *Device) Running() bool

func (*Device) Start

func (dev *Device) Start(ctx context.Context) error

func (*Device) Stop

func (dev *Device) Stop() error

type Point

type Point struct {
	model.Point
}

type Poller

type Poller struct {
	model.Poller
	Device *Device
	// contains filtered or unexported fields
}

Poller 采集器

func (*Poller) Execute

func (p *Poller) Execute(ctx context.Context)

Execute 执行

func (*Poller) Start

func (p *Poller) Start(ctx context.Context) (err error)

Start 启动

func (*Poller) Stop

func (p *Poller) Stop()

Stop 结束

Jump to

Keyboard shortcuts

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