metathings_deviced_connection

package
v0.99.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidArgument          = errors.New("invalid argument")
	ErrChannelClosed            = errors.New("channel closed")
	ErrUnexpectedResponse       = errors.New("unexpected response")
	ErrBridgeClosed             = errors.New("bridge closed")
	ErrTimeout                  = errors.New("timeout")
	ErrDuplicatedDeviceInstance = errors.New("duplicated device instance")
	ErrDeviceOffline            = errors.New("device offline")
)
View Source
var (
	ErrUnknownBridgeDriver = errors.New("unknown bridge driver")
)
View Source
var (
	ErrUnknownStorageDriver = errors.New("unknown storage driver")
)

Functions

This section is empty.

Types

type Bridge

type Bridge interface {
	Id() string
	North() Channel
	South() Channel
	Close() error
}

type BridgeFactory

type BridgeFactory interface {
	BuildBridge(device_id string, sess int64) (Bridge, error)
	GetBridge(br_id string) (Bridge, error)
}

func NewBridgeFactory

func NewBridgeFactory(name string, args ...interface{}) (BridgeFactory, error)

type Channel

type Channel interface {
	Send([]byte) error
	Recv() ([]byte, error)
	AsyncSend() chan<- []byte
	AsyncRecv() <-chan []byte
	Close() error
}

type Connection

type Connection interface {
	Err(err ...error) error
	Wait() chan bool
	Done()
	Cleanup()
}

func NewConnection

func NewConnection(cleanup_cb func()) Connection

type Side

type Side string
const (
	NORTH_SIDE Side = "north"
	SOUTH_SIDE Side = "south"
)

type Storage

type Storage interface {
	AddBridgeToDevice(dev_id string, sess int32, br_id string) error
	RemoveBridgeFromDevice(dev_id string, sess int32, br_id string) error
	ListBridgesFromDevice(dev_id string, sess int32) ([]string, error)
}

func NewStorage

func NewStorage(name string, args ...interface{}) (Storage, error)

type StorageFactory

type StorageFactory func(...interface{}) (Storage, error)

type StreamConnection

type StreamConnection interface {
	Connection
}

Jump to

Keyboard shortcuts

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