Documentation ¶
Index ¶
- Variables
- func GetSessionFromHeader(r *http.Request) int64
- func GetTokenFromHeader(r *http.Request) string
- func ParseHttpRequestBody(r *http.Request, v proto.Message) error
- func ParseHttpResponseBody(v proto.Message) ([]byte, error)
- type DeviceConnection
- type DeviceConnectionOption
- type MQTTPushFrameToFlowChannel
- type MQTTPushFrameToFlowChannelFactory
- type MQTTPushFrameToFlowChannelOption
- type MetathingsDeviceCloudService
- func (s *MetathingsDeviceCloudService) Heartbeat(w http.ResponseWriter, r *http.Request)
- func (s *MetathingsDeviceCloudService) IssueModuleToken(w http.ResponseWriter, r *http.Request)
- func (s *MetathingsDeviceCloudService) PushFrameToFlow(w http.ResponseWriter, r *http.Request)
- func (s *MetathingsDeviceCloudService) ShowModule(w http.ResponseWriter, r *http.Request)
- type MetathingsDeviceCloudServiceOption
- type PushFrameToFlowChannel
- type PushFrameToFlowChannelFactory
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrModuleNotFound = errors.New("module not found") ErrBadModuleEndpoint = errors.New("bad module endpoint") ErrUnsupportedModuleProxyDriver = errors.New("unsupported module proxy driver") ErrUnsupportedFlowChannelDriver = errors.New("unsupported flow channel driver") ErrUnmatchedRequestId = errors.New("unmatched request id") )
View Source
var (
ErrUnexpectedContentType = errors.New("unexpected content type")
)
View Source
var (
ErrUnsupportedPushFrameToFlowChannelDriver = errors.New("unsupported push frame to flow channel driver")
)
Functions ¶
func GetSessionFromHeader ¶
func GetTokenFromHeader ¶
Types ¶
type DeviceConnection ¶
type DeviceConnection struct {
// contains filtered or unexported fields
}
func NewDeviceConnection ¶
func NewDeviceConnection(args ...interface{}) (*DeviceConnection, error)
func (*DeviceConnection) Start ¶
func (dc *DeviceConnection) Start() error
func (*DeviceConnection) Stop ¶
func (dc *DeviceConnection) Stop() error
type DeviceConnectionOption ¶
type DeviceConnectionOption struct { DeviceCloud struct { Session struct { Id string } Connection struct { MQTT struct { Address string Username string Password string } } } Session struct { Startup int32 Major int32 Connection int64 } Device struct { Id string Modules []struct { Id string } } Config struct { HeartbeatInterval time.Duration HeartbeatTimeout time.Duration MaxReconnect int MinReconnectInterval time.Duration MaxReconnectInterval time.Duration PingInterval time.Duration SendConfigResponseIntervalA float64 SendConfigResponseIntervalB float64 MaxSendConfigResponseInterval float64 MaxSendConfigResponseRetry int } }
type MQTTPushFrameToFlowChannel ¶
type MQTTPushFrameToFlowChannel struct {
// contains filtered or unexported fields
}
func (*MQTTPushFrameToFlowChannel) Channel ¶
func (fc *MQTTPushFrameToFlowChannel) Channel() <-chan *pb.OpFrame
func (*MQTTPushFrameToFlowChannel) Close ¶
func (fc *MQTTPushFrameToFlowChannel) Close() error
type MQTTPushFrameToFlowChannelFactory ¶
type MQTTPushFrameToFlowChannelFactory struct{}
func (*MQTTPushFrameToFlowChannelFactory) New ¶
func (f *MQTTPushFrameToFlowChannelFactory) New(args ...interface{}) (PushFrameToFlowChannel, error)
type MetathingsDeviceCloudService ¶
type MetathingsDeviceCloudService struct {
// contains filtered or unexported fields
}
func NewMetathingsDeviceCloudService ¶
func NewMetathingsDeviceCloudService( opt *MetathingsDeviceCloudServiceOption, logger log.FieldLogger, storage storage.Storage, cli_fty *client_helper.ClientFactory, tknr token_helper.Tokener, tkvdr token_helper.TokenValidator, ) (*MetathingsDeviceCloudService, error)
func (*MetathingsDeviceCloudService) Heartbeat ¶
func (s *MetathingsDeviceCloudService) Heartbeat(w http.ResponseWriter, r *http.Request)
func (*MetathingsDeviceCloudService) IssueModuleToken ¶
func (s *MetathingsDeviceCloudService) IssueModuleToken(w http.ResponseWriter, r *http.Request)
func (*MetathingsDeviceCloudService) PushFrameToFlow ¶
func (s *MetathingsDeviceCloudService) PushFrameToFlow(w http.ResponseWriter, r *http.Request)
func (*MetathingsDeviceCloudService) ShowModule ¶
func (s *MetathingsDeviceCloudService) ShowModule(w http.ResponseWriter, r *http.Request)
type PushFrameToFlowChannel ¶
func NewPushFrameToFlowChannel ¶
func NewPushFrameToFlowChannel(name string, args ...interface{}) (PushFrameToFlowChannel, error)
type PushFrameToFlowChannelFactory ¶
type PushFrameToFlowChannelFactory interface {
New(args ...interface{}) (PushFrameToFlowChannel, error)
}
Click to show internal directories.
Click to hide internal directories.