Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶ added in v0.6.5
type Device struct {
ID ID
*topodevice.Device
}
Device is a topology service device
type Event ¶ added in v0.6.5
type Event struct {
// Type is the event type
Type EventType
// Device is the updated device
Device Device
}
Event is a device event
type EventType ¶ added in v0.6.5
type EventType string
EventType is a device event type
const ( // EventNone is an event indicating the replay of an existing device EventNone EventType = "" // EventAdded indicates a newly added device EventAdded EventType = "added" // EventUpdated indicates an updated device EventUpdated EventType = "updated" // EventRemoved indicates a removed device EventRemoved EventType = "removed" )
type Store ¶
type Store interface {
// Get gets a device by ID
Get(ID) (*Device, error)
// Update updates a given device
Update(*Device) (*Device, error)
// List lists the devices in the store
List(chan<- Device) error
// Watch watches the device store for changes
Watch(chan<- Event) error
}
Store is a device store
func NewStore ¶
func NewStore(client topodevice.DeviceServiceClient) (Store, error)
NewStore returns a new device store for the given client
func NewTopoStore ¶
func NewTopoStore(topoEndpoint string, opts ...grpc.DialOption) (Store, error)
NewTopoStore returns a new topo-based device store
Click to show internal directories.
Click to hide internal directories.