cache

package
v0.10.12 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	io.Closer

	// GetDevicesByID returns the devices that match the given device ID
	GetDevicesByID(id device.ID) []*Info

	// GetDevicesByType gets all devices of the given type
	GetDevicesByType(deviceType device.Type) []*Info

	// GetDevicesByVersion gets all devices of the given type/version
	GetDevicesByVersion(deviceType device.Type, deviceVersion device.Version) []*Info

	// GetDevices returns the set of devices in the cache
	GetDevices() []*Info

	// Watch allows tracking updates of the cache
	Watch(ch chan<- stream.Event, replay bool) (stream.Context, error)
}

Cache is a device type/version cache

func NewCache

func NewCache(networkChangeStore networkchangestore.Store,
	deviceSnapshotStore devicesnapshotstore.Store) (Cache, error)

NewCache returns a new cache based on the NetworkChange store

type Info

type Info struct {
	DeviceID device.ID
	Type     device.Type
	Version  device.Version
}

Info is device type/version info

Jump to

Keyboard shortcuts

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