worker

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionLogger

type ConnectionLogger interface {
	LogDeviceDisconnect(id string) error
	LogDeviceConnect(id string) error
	LogHubDisconnect(id string) error
	LogHubConnect(id string) error
}

type DeviceProvider

type DeviceProvider interface {
	GetNextDevice() (device model.ExtendedDevice, resets int, err error)
	GetDevice(id string) (result model.ExtendedDevice, err error)
}

type DeviceTypeProvider

type DeviceTypeProvider interface {
	GetDeviceType(deviceTypeId string) (dt models.DeviceType, err error)
}

type HubProvider

type HubProvider interface {
	GetNextHub() (hub model.ExtendedHub, resets int, err error)
	GetHub(id string) (result model.ExtendedHub, err error)
}

type Verne

type Verne interface {
	CheckTopic(topic string) (result bool, err error)
	CheckClient(clientId string) (result bool, err error)
}

type Worker

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

func New

func New(config configuration.Config, logger ConnectionLogger, deviceprovider DeviceProvider, hubprovider HubProvider, deviceTypeProvider DeviceTypeProvider, verne Verne, metrics *prometheus.Metrics) (*Worker, error)

func (*Worker) RunDeviceLoop

func (this *Worker) RunDeviceLoop(ctx context.Context, wg *sync.WaitGroup) error

func (*Worker) RunHubLoop

func (this *Worker) RunHubLoop(ctx context.Context, wg *sync.WaitGroup) error

Jump to

Keyboard shortcuts

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