device

package
v0.0.0-...-5b6cbe3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ID         string       `validate:"required"`
	Parameters *viper.Viper `validate:"required"`
	Hub        *hub.Hub     `validate:"required"`
}

Config defines the running paramers of the Device

type Device

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

Device is a virtual proxy composed out of several device.Device processing layers

func New

func New(config Config) (*Device, error)

New returns a local proxy Device. It is used to store data to third-party data store

func (*Device) Capabilities

func (d *Device) Capabilities() []selector.Capability

Capabilities returns the capabilities of the device

func (*Device) Close

func (d *Device) Close() error

Close shutdowns the device

func (*Device) Location

func (d *Device) Location() string

Location returns the node where the device is running

func (*Device) NewReadChannel

func (d *Device) NewReadChannel(name string) (device.ReadChannel, error)

NewReadChannel opens an cross-layer channel for reading data from an isolated collection on the backend

func (*Device) NewWriteChannel

func (d *Device) NewWriteChannel(name string) (device.WriteChannel, error)

NewWriteChannel opens a cross-layer channel for writing data into an isolated collection on the backend. Collections are immutable

func (*Device) Scan

func (d *Device) Scan() ([]string, []device.Item, error)

Scan returns a list of items and metadata that exist on the backend associated with the virtual device

func (*Device) SetBackend

func (d *Device) SetBackend(_ device.Device)

SetBackend defines the backend for the current device layer

func (*Device) String

func (d *Device) String() string

String returns a descriptive name for the device

Jump to

Keyboard shortcuts

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