providers

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyBatch = errors.New("empty batch")
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 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.PermDevice, err error)

func (*DeviceProvider) GetNextDevice

func (this *DeviceProvider) GetNextDevice() (device model.PermDevice, 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.PermHub, err error)

func (*HubProvider) GetNextHub

func (this *HubProvider) GetNextHub() (hub model.PermHub, err error)

func (*HubProvider) HubMatchesProtocol

func (this *HubProvider) HubMatchesProtocol(hub model.PermHub) (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