metathings_deviced_connection

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 23 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")
	ErrReceiveTimeout           = errors.New("receive 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")
)
View Source
var (
	InterceptorStop = errors.New("interceptor stop")
)

Functions

func ErrUnexpectedResponse

func ErrUnexpectedResponse(res []byte) error

func ToBridgeFactory added in v1.1.28

func ToBridgeFactory(y *BridgeFactory) func(string, interface{}) error

func ToStorage added in v1.1.28

func ToStorage(y *Storage) func(string, interface{}) error

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 ConnectResponseInterceptor added in v0.99.2

type ConnectResponseInterceptor func(*pb.ConnectResponse) error

type ConnectResponseInterceptorChain added in v0.99.2

type ConnectResponseInterceptorChain func(*pb.ConnectResponse) error

func NewConnectResponseInterceptorChain added in v0.99.2

func NewConnectResponseInterceptorChain(args ...interface{}) ConnectResponseInterceptorChain

type ConnectResponseMatcher added in v0.99.2

type ConnectResponseMatcher func(*pb.ConnectResponse) bool

func NewConnectResponseUnaryCallMatcher added in v0.99.2

func NewConnectResponseUnaryCallMatcher(kind pb.ConnectMessageKind, component, name, method string) ConnectResponseMatcher

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