metathings_deviced_sdk

package
v1.2.13-alpha2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedSimpleStorageFactory = errors.New("unsupported simple storage driver")
	ErrUnsupportedCallerFactory        = errors.New("unsupported caller driver")
	ErrUnsupportedFlowFactory          = errors.New("unsupported flow driver")

	ErrMethodNotFound = errors.New("method not found")
	ErrModuleNotFound = errors.New("module not found")
	ErrConfigNotFound = errors.New("config not found")
)
View Source
var (
	SimpleStorageListOption_SetRecursive = SetBool("recursive")
	SimpleStorageListOption_SetDepth     = SetInt("depth")
)

Functions

func SetBool

func SetBool(key string) func(bool) func(map[string]interface{})

func SetInt

func SetInt(key string) func(int) func(map[string]interface{})

func ToCaller added in v1.1.27

func ToCaller(v *Caller) func(string, interface{}) error

func ToFlow added in v1.2.3

func ToFlow(v *Flow) func(string, interface{}) error

func ToProtobuf added in v1.1.27

func ToProtobuf(x *Config) (*pb.OpConfig, error)

func ToSimpleStorage

func ToSimpleStorage(v *SimpleStorage) func(string, interface{}) error

Types

type Caller added in v1.1.27

type Caller interface {
	UnaryCall(ctx context.Context, device, module, method string, arguments map[string]interface{}) (map[string]interface{}, error)
}

func NewCaller added in v1.1.27

func NewCaller(name string, args ...interface{}) (Caller, error)

func NewDevicedCaller added in v1.1.27

func NewDevicedCaller(args ...interface{}) (Caller, error)

type CallerFactory added in v1.1.27

type CallerFactory func(...interface{}) (Caller, error)

type Config added in v1.1.27

type Config struct {
	*pb.Config
	// contains filtered or unexported fields
}

func FromConfig added in v1.1.27

func FromConfig(x *pb.Config) (*Config, error)

func LookupConfig added in v1.1.27

func LookupConfig(cfgs []*pb.Config, alias string) (*Config, error)

func (*Config) Get added in v1.1.27

func (c *Config) Get(selector string) *objx.Value

func (*Config) Set added in v1.1.27

func (c *Config) Set(selector string, value interface{})

type DevicedCaller added in v1.1.27

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

func (*DevicedCaller) UnaryCall added in v1.1.27

func (c *DevicedCaller) UnaryCall(ctx context.Context, device, module, method string, arguments map[string]interface{}) (map[string]interface{}, error)

type DevicedFlow added in v1.2.3

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

func (*DevicedFlow) PushFrame added in v1.2.3

func (f *DevicedFlow) PushFrame(ctx context.Context, device, flow string, data interface{}) error

type DevicedSimpleStorage

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

func (*DevicedSimpleStorage) Get

func (s *DevicedSimpleStorage) Get(ctx context.Context, obj *pb.Object) (*pb.Object, error)

func (*DevicedSimpleStorage) GetContent

func (s *DevicedSimpleStorage) GetContent(ctx context.Context, obj *pb.Object) ([]byte, error)

func (*DevicedSimpleStorage) List

func (*DevicedSimpleStorage) Put

func (s *DevicedSimpleStorage) Put(ctx context.Context, obj *pb.Object, rd io.Reader) error

func (*DevicedSimpleStorage) Remove

func (s *DevicedSimpleStorage) Remove(ctx context.Context, obj *pb.Object) error

func (*DevicedSimpleStorage) Rename

func (s *DevicedSimpleStorage) Rename(ctx context.Context, src, dst *pb.Object) error

type Flow added in v1.2.3

type Flow interface {
	PushFrame(ctx context.Context, device, flow string, data interface{}) error
}

func NewDevicedFlow added in v1.2.3

func NewDevicedFlow(args ...interface{}) (Flow, error)

func NewFlow added in v1.2.3

func NewFlow(name string, args ...interface{}) (Flow, error)

type FlowFactory added in v1.2.3

type FlowFactory func(...interface{}) (Flow, error)

type MockCaller added in v1.1.27

type MockCaller struct {
	mock.Mock
	// contains filtered or unexported fields
}

func (*MockCaller) UnaryCall added in v1.1.27

func (m *MockCaller) UnaryCall(ctx context.Context, device, module, method string, arguments map[string]interface{}) (map[string]interface{}, error)

type MockFlow added in v1.2.3

type MockFlow struct {
	mock.Mock
}

func (*MockFlow) PushFrame added in v1.2.3

func (m *MockFlow) PushFrame(ctx context.Context, device, flow string, data interface{}) error

type MockSimpleStorage

type MockSimpleStorage struct {
	mock.Mock
	// contains filtered or unexported fields
}

func (*MockSimpleStorage) Get

func (m *MockSimpleStorage) Get(ctx context.Context, obj *pb.Object) (*pb.Object, error)

func (*MockSimpleStorage) GetContent

func (m *MockSimpleStorage) GetContent(ctx context.Context, obj *pb.Object) ([]byte, error)

func (*MockSimpleStorage) List

func (m *MockSimpleStorage) List(ctx context.Context, obj *pb.Object, opts ...SimpleStorageListOption) ([]*pb.Object, error)

func (*MockSimpleStorage) Put

func (m *MockSimpleStorage) Put(ctx context.Context, obj *pb.Object, rd io.Reader) error

func (*MockSimpleStorage) Remove

func (m *MockSimpleStorage) Remove(ctx context.Context, obj *pb.Object) error

func (*MockSimpleStorage) Rename

func (m *MockSimpleStorage) Rename(ctx context.Context, src, dst *pb.Object) error

func (*MockSimpleStorage) SetGetContentResult

func (m *MockSimpleStorage) SetGetContentResult(buf []byte)

func (*MockSimpleStorage) SetGetResult

func (m *MockSimpleStorage) SetGetResult(obj *pb.Object)

func (*MockSimpleStorage) SetListResult

func (m *MockSimpleStorage) SetListResult(objs []*pb.Object)

type SimpleStorage

type SimpleStorage interface {
	Put(context.Context, *pb.Object, io.Reader) error
	Remove(context.Context, *pb.Object) error
	Rename(ctx context.Context, src *pb.Object, dst *pb.Object) error
	Get(context.Context, *pb.Object) (*pb.Object, error)
	GetContent(context.Context, *pb.Object) ([]byte, error)
	List(context.Context, *pb.Object, ...SimpleStorageListOption) ([]*pb.Object, error)
}

func NewDevicedSimpleStorage

func NewDevicedSimpleStorage(args ...interface{}) (SimpleStorage, error)

func NewSimpleStorage

func NewSimpleStorage(name string, args ...interface{}) (SimpleStorage, error)

type SimpleStorageFactory

type SimpleStorageFactory func(...interface{}) (SimpleStorage, error)

type SimpleStorageListOption

type SimpleStorageListOption func(map[string]interface{})

Jump to

Keyboard shortcuts

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