worker

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ConnectionStateAnnotation = "connected"

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.PermDevice, err error)
	GetDevice(id string) (result model.PermDevice, err error)
}

type DeviceTypeProvider

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

type HubProvider

type HubProvider interface {
	GetNextHub() (device model.PermHub, err error)
	GetHub(id string) (result model.PermHub, 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