providers

package
v0.0.20 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BatchNoMatchAfterMultipleResets = errors.New("no matching element found after multiple resets")
View Source
var BatchNotInWindowErr = errors.New("no matching element in batch window")
View Source
var ErrNotFound = errors.New("key not found in cache")

Functions

func DeviceTypeUsesHandledProtocol

func DeviceTypeUsesHandledProtocol(dt models.DeviceType, handledProtocols map[string]bool) (result bool)

Types

type Batch added in v0.0.19

type Batch[T any] struct {
	// contains filtered or unexported fields
}

func NewBatch added in v0.0.19

func NewBatch[T any](getter func(offset int64) ([]T, error), checker func(T) (bool, error)) *Batch[T]

func (*Batch[T]) GetNext added in v0.0.19

func (this *Batch[T]) GetNext() (result T, resets int, err error)

type Cache

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

func NewCache

func NewCache(expiration time.Duration) *Cache

func (*Cache) Reset

func (this *Cache) Reset()

func (*Cache) Use

func (this *Cache) Use(key string, getter func() (interface{}, error), result interface{}) (err error)

func (*Cache) UseWithExpiration

func (this *Cache) UseWithExpiration(key string, expiration time.Duration, getter func() (interface{}, error), result interface{}) (err error)

type DeviceProvider

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

func NewDeviceProvider

func NewDeviceProvider(config configuration.Config, tokengen TokenGenerator, devicetypes DeviceTypeProviderInterface) (result *DeviceProvider, err error)

func (*DeviceProvider) GetDevice

func (this *DeviceProvider) GetDevice(id string) (result model.ExtendedDevice, err error)

func (*DeviceProvider) GetNextDevice

func (this *DeviceProvider) GetNextDevice() (device model.ExtendedDevice, resets int, err error)

type DeviceTypeProvider

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

func NewDeviceTypeProvider

func NewDeviceTypeProvider(config configuration.Config, tokengen TokenGenerator) (*DeviceTypeProvider, error)

func (*DeviceTypeProvider) GetDeviceType

func (this *DeviceTypeProvider) GetDeviceType(id string) (result model.DeviceType, err error)

type DeviceTypeProviderInterface

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

type HubProvider

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

func NewHubProvider

func NewHubProvider(config configuration.Config, tokengen TokenGenerator, devicetypes DeviceTypeProviderInterface) (result *HubProvider, err error)

func (*HubProvider) GetHub

func (this *HubProvider) GetHub(id string) (result model.ExtendedHub, err error)

func (*HubProvider) GetNextHub

func (this *HubProvider) GetNextHub() (hub model.ExtendedHub, resets int, err error)

func (*HubProvider) HubMatchesProtocol

func (this *HubProvider) HubMatchesProtocol(hub model.ExtendedHub) (result bool, err error)

type Item

type Item struct {
	Key   string
	Value []byte
}

type TokenGenerator

type TokenGenerator interface {
	Access() (token string, err error)
}

Jump to

Keyboard shortcuts

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