Documentation ¶
Index ¶
- Constants
- Variables
- func ToModule(v **Module) func(string, interface{}) error
- type GrpcModuleProxy
- type GrpcModuleProxyFactory
- type GrpcModuleServer
- type GrpcModuleServiceClientFactory
- type GrpcModuleServiceClientFactoryImpl
- type GrpcModuleWrapper
- type Kernel
- func (k *Kernel) Config() *KernelConfig
- func (k *Kernel) Context() context.Context
- func (k *Kernel) GetObject(name string) (*deviced_pb.Object, error)
- func (k *Kernel) GetObjectContent(name string) ([]byte, error)
- func (k *Kernel) Heartbeat() error
- func (k *Kernel) PutObject(name string, content io.Reader) error
- func (k *Kernel) PutObjects(objects map[string]io.Reader) error
- func (k *Kernel) RemoveObject(name string) error
- func (k *Kernel) RemoveObjects(names []string) error
- func (k *Kernel) RenameObject(src, dst string) error
- func (k *Kernel) Show() (*deviced_pb.Module, error)
- type KernelConfig
- type Module
- func (m *Module) GetObject(name string) (*deviced_pb.Object, error)
- func (m *Module) GetObjectContent(name string) ([]byte, error)
- func (m *Module) HeartbeatLoop()
- func (m *Module) Init() error
- func (m *Module) Kernel() *Kernel
- func (m *Module) Launch() error
- func (m *Module) Logger() log.FieldLogger
- func (m *Module) Name() string
- func (m *Module) PutObject(name string, content io.Reader) error
- func (m *Module) PutObjects(objects map[string]io.Reader) error
- func (m *Module) RemoveObject(name string) error
- func (m *Module) RemoveObjects(names []string) error
- func (m *Module) RenameObject(src, dst string) error
- func (m *Module) Serve() error
- func (m *Module) Stop()
- func (m *Module) Target() interface{}
- func (m *Module) WithNamespace(name string) string
- type ModuleOption
- type ModuleProxy
- type ModuleProxyFactory
- type ModuleProxyStream
- type ModuleServer
- type ModuleServerFactory
- type ModuleServiceInitializer
- type ModuleServiceLookuper
- type NewKernelOption
Constants ¶
View Source
const METATHINGS_COMPONENT_PREFIX = "mtc"
Variables ¶
View Source
var ( ErrBadScheme = errors.New("bad scheme") ErrBadServiceEndpoint = errors.New("bad service endpoint") ErrDefaultAddressRequired = errors.New("default address required") ErrDeviceAddressRequired = errors.New("device address required") ErrInvalidArguments = errors.New("invalid arguments") )
View Source
var (
ErrHandleUnimplemented = errors.New("handle unimplemented")
)
View Source
var (
ErrUnknownModuleProxyDriver = errors.New("unknown module proxy driver")
)
View Source
var (
ErrUnknownModuleServerAdapter = errors.New("unknown module server adapter")
)
Functions ¶
Types ¶
type GrpcModuleProxy ¶
type GrpcModuleProxy struct {
// contains filtered or unexported fields
}
func (*GrpcModuleProxy) StreamCall ¶
func (self *GrpcModuleProxy) StreamCall(ctx context.Context, method string, upstm ModuleProxyStream) error
type GrpcModuleProxyFactory ¶
type GrpcModuleProxyFactory struct{}
func (*GrpcModuleProxyFactory) NewModuleProxy ¶
func (self *GrpcModuleProxyFactory) NewModuleProxy(args ...interface{}) (ModuleProxy, error)
type GrpcModuleServer ¶
type GrpcModuleServer struct {
// contains filtered or unexported fields
}
func (*GrpcModuleServer) Serve ¶
func (s *GrpcModuleServer) Serve() error
func (*GrpcModuleServer) Stop ¶
func (s *GrpcModuleServer) Stop()
type GrpcModuleServiceClientFactory ¶
type GrpcModuleServiceClientFactory interface {
NewModuleServiceClient(opts ...grpc.DialOption) (pb.ModuleServiceClient, client_helper.CloseFn, error)
}
func NewGrpcModuleServiceClientFactory ¶
func NewGrpcModuleServiceClientFactory(addr string) GrpcModuleServiceClientFactory
type GrpcModuleServiceClientFactoryImpl ¶
type GrpcModuleServiceClientFactoryImpl struct {
Address string
}
func (*GrpcModuleServiceClientFactoryImpl) NewModuleServiceClient ¶
func (self *GrpcModuleServiceClientFactoryImpl) NewModuleServiceClient(opts ...grpc.DialOption) (pb.ModuleServiceClient, client_helper.CloseFn, error)
type GrpcModuleWrapper ¶
type GrpcModuleWrapper struct {
// contains filtered or unexported fields
}
func NewGrpcModuleWrapper ¶
func NewGrpcModuleWrapper(target interface{}, logger log.FieldLogger) *GrpcModuleWrapper
func (*GrpcModuleWrapper) StreamCall ¶
func (self *GrpcModuleWrapper) StreamCall(upstm pb.ModuleService_StreamCallServer) error
func (*GrpcModuleWrapper) UnaryCall ¶
func (self *GrpcModuleWrapper) UnaryCall(ctx context.Context, req *pb.UnaryCallRequest) (*pb.UnaryCallResponse, error)
type Kernel ¶
type Kernel struct {
// contains filtered or unexported fields
}
func NewKernel ¶
func NewKernel(opt *NewKernelOption) (*Kernel, error)
func (*Kernel) Config ¶
func (k *Kernel) Config() *KernelConfig
func (*Kernel) RemoveObject ¶
func (*Kernel) RemoveObjects ¶
func (*Kernel) RenameObject ¶
type KernelConfig ¶
func NewKernelConfigFromText ¶
func NewKernelConfigFromText(text string) (*KernelConfig, error)
func (*KernelConfig) Raw ¶
func (kc *KernelConfig) Raw() *viper.Viper
func (*KernelConfig) Sub ¶
func (kc *KernelConfig) Sub(key string) *KernelConfig
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) HeartbeatLoop ¶
func (m *Module) HeartbeatLoop()
func (*Module) Logger ¶
func (m *Module) Logger() log.FieldLogger
func (*Module) RemoveObject ¶
func (*Module) RemoveObjects ¶
func (*Module) RenameObject ¶
func (*Module) WithNamespace ¶
type ModuleOption ¶
type ModuleProxy ¶
type ModuleProxy interface { UnaryCall(ctx context.Context, method string, req *any.Any) (*any.Any, error) StreamCall(ctx context.Context, method string, stm ModuleProxyStream) error }
func NewModuleProxy ¶
func NewModuleProxy(name string, args ...interface{}) (ModuleProxy, error)
type ModuleProxyFactory ¶
type ModuleProxyFactory interface {
NewModuleProxy(args ...interface{}) (ModuleProxy, error)
}
type ModuleProxyStream ¶
type ModuleProxyStream interface { Send(*any.Any) error Recv() (*any.Any, error) grpc.ClientStream }
func NewModuleProxyStream ¶
func NewModuleProxyStream(stm deviced_pb.DevicedService_ConnectClient, session int64) ModuleProxyStream
type ModuleServer ¶
type ModuleServer interface { Stop() Serve() error }
func NewGrpcModuleServer ¶
func NewGrpcModuleServer(m *Module) (ModuleServer, error)
func NewModuleServer ¶
func NewModuleServer(name string, mdl *Module) (ModuleServer, error)
type ModuleServerFactory ¶
type ModuleServerFactory func(*Module) (ModuleServer, error)
type ModuleServiceLookuper ¶
type ModuleServiceLookuper interface { LookupUnaryCall() LookupStreamCall() }
Click to show internal directories.
Click to hide internal directories.