device

package
v0.6.21 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type   EventType
	Device *deviceapi.Device
}

Event is a store event for a device

type EventType

type EventType string

EventType provides the type for a device event

const (
	// EventNone is no event
	EventNone EventType = ""
	// EventInserted is inserted
	EventInserted EventType = "inserted"
	// EventUpdated is updated
	EventUpdated EventType = "updated"
	// EventRemoved is removed
	EventRemoved EventType = "removed"
)

type Store

type Store interface {
	io.Closer

	// Load loads a device from the store
	Load(deviceID deviceapi.ID) (*deviceapi.Device, error)

	// Store stores a device in the store
	Store(*deviceapi.Device) error

	// Delete deletes a device from the store
	Delete(*deviceapi.Device) error

	// List streams devices to the given channel
	List(chan<- *deviceapi.Device) error

	// Watch streams device events to the given channel
	Watch(chan<- *Event) error
}

Store stores topology information

func NewAtomixStore

func NewAtomixStore() (Store, error)

NewAtomixStore returns a new persistent Store

func NewLocalStore

func NewLocalStore() (Store, error)

NewLocalStore returns a new local device store

Jump to

Keyboard shortcuts

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