Documentation ¶
Index ¶
- Constants
- Variables
- func IssueModuleTokenWithClient(cli identityd2_pb.IdentitydServiceClient, ctx context.Context, ...) (*identityd2_pb.Token, error)
- type MetathingsDeviceService
- type MetathingsDeviceServiceImpl
- func (self *MetathingsDeviceServiceImpl) GetObject(ctx context.Context, req *pb.GetObjectRequest) (*pb.GetObjectResponse, error)
- func (self *MetathingsDeviceServiceImpl) GetObjectContent(ctx context.Context, req *pb.GetObjectContentRequest) (*pb.GetObjectContentResponse, error)
- func (self *MetathingsDeviceServiceImpl) GetObjectStreamingContent(context.Context, *pb.GetObjectStreamingContentRequest) (*pb.GetObjectStreamingContentResponse, error)
- func (self *MetathingsDeviceServiceImpl) Heartbeat(ctx context.Context, req *pb.HeartbeatRequest) (*empty.Empty, error)
- func (self *MetathingsDeviceServiceImpl) IsIgnoreMethod(md *grpc_helper.MethodDescription) bool
- func (self *MetathingsDeviceServiceImpl) IssueModuleToken(ctx context.Context, req *pb.IssueModuleTokenRequest) (*pb.IssueModuleTokenResponse, error)
- func (self *MetathingsDeviceServiceImpl) ListObjects(ctx context.Context, req *pb.ListObjectsRequest) (*pb.ListObjectsResponse, error)
- func (self *MetathingsDeviceServiceImpl) PushFrameToFlow(stm pb.DeviceService_PushFrameToFlowServer) error
- func (self *MetathingsDeviceServiceImpl) PushFrameToFlowOnce(ctx context.Context, req *pb.PushFrameToFlowOnceRequest) (*empty.Empty, error)
- func (self *MetathingsDeviceServiceImpl) PutObject(ctx context.Context, req *pb.PutObjectRequest) (*empty.Empty, error)
- func (self *MetathingsDeviceServiceImpl) PutObjectStreaming(stm pb.DeviceService_PutObjectStreamingServer) error
- func (self *MetathingsDeviceServiceImpl) RemoveObject(ctx context.Context, req *pb.RemoveObjectRequest) (*empty.Empty, error)
- func (self *MetathingsDeviceServiceImpl) RenameObject(ctx context.Context, req *pb.RenameObjectRequest) (*empty.Empty, error)
- func (self *MetathingsDeviceServiceImpl) ShowModule(ctx context.Context, req *empty.Empty) (*pb.ShowModuleResponse, error)
- func (self *MetathingsDeviceServiceImpl) ShowModuleFirmwareDescriptor(ctx context.Context, _ *empty.Empty) (*pb.ShowModuleFirmwareDescriptorResponse, error)
- func (self *MetathingsDeviceServiceImpl) Start() error
- func (self *MetathingsDeviceServiceImpl) Stop() error
- type MetathingsDeviceServiceOption
- type Module
- type ModuleDatabase
- type ModuleDatabaseImpl
- type ModuleImpl
- func (self *ModuleImpl) Heartbeat()
- func (self *ModuleImpl) HeartbeatAt() time.Time
- func (self *ModuleImpl) Id() string
- func (self *ModuleImpl) IsAlive() bool
- func (self *ModuleImpl) StreamCall(ctx context.Context, cfg_req *deviced_pb.ConnectRequest, ...) error
- func (self *ModuleImpl) UnaryCall(ctx context.Context, req *deviced_pb.OpUnaryCallValue) (*deviced_pb.UnaryCallValue, error)
- type ModuleStream
Constants ¶
View Source
const ( SEND_RES_MAX_RETRY = 16 A_SEND_RES_INTERVAL = float64(300) B_SEND_RES_INTERVAL = float64(500) MAX_SEND_RES_INTERVAL = float64(3000) )
Variables ¶
View Source
var ( ErrInvalidEndpoint = errors.New("invalid endpoint") ErrInvalidModuleProxyDriver = errors.New("invalid module proxy driver") )
View Source
var (
ErrModuleNotFound = errors.New("module not found")
)
Functions ¶
func IssueModuleTokenWithClient ¶ added in v1.0.0
func IssueModuleTokenWithClient(cli identityd2_pb.IdentitydServiceClient, ctx context.Context, credential_id string, timestamp time.Time, nonce int64, hmac string) (*identityd2_pb.Token, error)
Types ¶
type MetathingsDeviceService ¶
type MetathingsDeviceService interface { version_helper.Versioner pb.DeviceServiceServer Start() error Stop() error }
func NewMetathingsDeviceService ¶
func NewMetathingsDeviceService( ver version_helper.Versioner, tknr token_helper.Tokener, cli_fty *client_helper.ClientFactory, logger log.FieldLogger, tkvdr token_helper.TokenValidator, opt *MetathingsDeviceServiceOption, app_getter *fx_helper.FxAppGetter, bs binary_synchronizer.BinarySynchronizer, ) (MetathingsDeviceService, error)
type MetathingsDeviceServiceImpl ¶
type MetathingsDeviceServiceImpl struct { grpc_auth.ServiceAuthFuncOverride version_helper.Versioner *grpc_helper.ErrorParser // contains filtered or unexported fields }
func (*MetathingsDeviceServiceImpl) GetObject ¶
func (self *MetathingsDeviceServiceImpl) GetObject(ctx context.Context, req *pb.GetObjectRequest) (*pb.GetObjectResponse, error)
func (*MetathingsDeviceServiceImpl) GetObjectContent ¶
func (self *MetathingsDeviceServiceImpl) GetObjectContent(ctx context.Context, req *pb.GetObjectContentRequest) (*pb.GetObjectContentResponse, error)
func (*MetathingsDeviceServiceImpl) GetObjectStreamingContent ¶
func (self *MetathingsDeviceServiceImpl) GetObjectStreamingContent(context.Context, *pb.GetObjectStreamingContentRequest) (*pb.GetObjectStreamingContentResponse, error)
func (*MetathingsDeviceServiceImpl) Heartbeat ¶
func (self *MetathingsDeviceServiceImpl) Heartbeat(ctx context.Context, req *pb.HeartbeatRequest) (*empty.Empty, error)
func (*MetathingsDeviceServiceImpl) IsIgnoreMethod ¶
func (self *MetathingsDeviceServiceImpl) IsIgnoreMethod(md *grpc_helper.MethodDescription) bool
func (*MetathingsDeviceServiceImpl) IssueModuleToken ¶
func (self *MetathingsDeviceServiceImpl) IssueModuleToken(ctx context.Context, req *pb.IssueModuleTokenRequest) (*pb.IssueModuleTokenResponse, error)
func (*MetathingsDeviceServiceImpl) ListObjects ¶
func (self *MetathingsDeviceServiceImpl) ListObjects(ctx context.Context, req *pb.ListObjectsRequest) (*pb.ListObjectsResponse, error)
func (*MetathingsDeviceServiceImpl) PushFrameToFlow ¶
func (self *MetathingsDeviceServiceImpl) PushFrameToFlow(stm pb.DeviceService_PushFrameToFlowServer) error
func (*MetathingsDeviceServiceImpl) PushFrameToFlowOnce ¶ added in v1.2.9
func (self *MetathingsDeviceServiceImpl) PushFrameToFlowOnce(ctx context.Context, req *pb.PushFrameToFlowOnceRequest) (*empty.Empty, error)
func (*MetathingsDeviceServiceImpl) PutObject ¶
func (self *MetathingsDeviceServiceImpl) PutObject(ctx context.Context, req *pb.PutObjectRequest) (*empty.Empty, error)
func (*MetathingsDeviceServiceImpl) PutObjectStreaming ¶ added in v1.1.16
func (self *MetathingsDeviceServiceImpl) PutObjectStreaming(stm pb.DeviceService_PutObjectStreamingServer) error
func (*MetathingsDeviceServiceImpl) RemoveObject ¶
func (self *MetathingsDeviceServiceImpl) RemoveObject(ctx context.Context, req *pb.RemoveObjectRequest) (*empty.Empty, error)
func (*MetathingsDeviceServiceImpl) RenameObject ¶
func (self *MetathingsDeviceServiceImpl) RenameObject(ctx context.Context, req *pb.RenameObjectRequest) (*empty.Empty, error)
func (*MetathingsDeviceServiceImpl) ShowModule ¶
func (self *MetathingsDeviceServiceImpl) ShowModule(ctx context.Context, req *empty.Empty) (*pb.ShowModuleResponse, error)
func (*MetathingsDeviceServiceImpl) ShowModuleFirmwareDescriptor ¶ added in v1.2.0
func (self *MetathingsDeviceServiceImpl) ShowModuleFirmwareDescriptor(ctx context.Context, _ *empty.Empty) (*pb.ShowModuleFirmwareDescriptorResponse, error)
func (*MetathingsDeviceServiceImpl) Start ¶
func (self *MetathingsDeviceServiceImpl) Start() error
func (*MetathingsDeviceServiceImpl) Stop ¶
func (self *MetathingsDeviceServiceImpl) Stop() error
type Module ¶
type Module interface { Id() string Heartbeat() IsAlive() bool HeartbeatAt() time.Time UnaryCall(ctx context.Context, req *deviced_pb.OpUnaryCallValue) (*deviced_pb.UnaryCallValue, error) StreamCall(ctx context.Context, cfg_req *deviced_pb.ConnectRequest, stm deviced_pb.DevicedService_ConnectClient) error }
func NewModule ¶
func NewModule(logger log.FieldLogger, module *deviced_pb.Module, alive_timeout time.Duration) Module
type ModuleDatabase ¶
func NewModuleDatabase ¶
func NewModuleDatabase( modules []*deviced_pb.Module, alive_timeout time.Duration, logger log.FieldLogger, ) ModuleDatabase
type ModuleDatabaseImpl ¶
type ModuleDatabaseImpl struct {
// contains filtered or unexported fields
}
func (*ModuleDatabaseImpl) All ¶
func (self *ModuleDatabaseImpl) All() []Module
type ModuleImpl ¶
type ModuleImpl struct {
// contains filtered or unexported fields
}
func (*ModuleImpl) Heartbeat ¶
func (self *ModuleImpl) Heartbeat()
func (*ModuleImpl) HeartbeatAt ¶
func (self *ModuleImpl) HeartbeatAt() time.Time
func (*ModuleImpl) Id ¶
func (self *ModuleImpl) Id() string
func (*ModuleImpl) IsAlive ¶
func (self *ModuleImpl) IsAlive() bool
func (*ModuleImpl) StreamCall ¶
func (self *ModuleImpl) StreamCall(ctx context.Context, cfg_req *deviced_pb.ConnectRequest, upstm deviced_pb.DevicedService_ConnectClient) error
func (*ModuleImpl) UnaryCall ¶
func (self *ModuleImpl) UnaryCall(ctx context.Context, req *deviced_pb.OpUnaryCallValue) (*deviced_pb.UnaryCallValue, error)
type ModuleStream ¶
type ModuleStream interface { Send(*deviced_pb.OpStreamCallValue) error Recv() (*deviced_pb.StreamCallValue, error) }
Source Files ¶
- constants.go
- errors.go
- get_object.go
- get_object_content.go
- get_object_streaming_content.go
- handle.go
- heartbeat.go
- helper.go
- issue_module_token.go
- list_objects.go
- main_loop.go
- module.go
- module_database.go
- ping.go
- push_frame_to_flow.go
- push_frame_to_flow_once.go
- put_object.go
- put_object_streaming.go
- remove_object.go
- rename_object.go
- service.go
- show_module.go
- show_module_firmware_descriptor.go
- start.go
- sync_firmware.go
Click to show internal directories.
Click to hide internal directories.