message

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotifyProductAdded  = "ProductAdded"
	NotifyProductDelete = "ProductDelete"
	NotifyAddDevice     = "AddDevice"
	NotifyDeleteDevice  = "DeleteDevice"
	NotifyAction        = "Action"
	NotifySerialNet     = "SerialNet"
	NotifyCheckStatus   = "CheckStatus"
	NotifySimulatorSend = "SimulatorSend"
	NotifyUpgrade       = "Upgrade"
)

Variables

Functions

This section is empty.

Types

type CheckStatusHandler

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

func (*CheckStatusHandler) Handle

func (csh *CheckStatusHandler) Handle(downstream *Downstream) error

func (*CheckStatusHandler) NotifyType

func (csh *CheckStatusHandler) NotifyType() string

type Downstream

type Downstream struct {
	DalID       string      `json:"dalId"`
	NotifyType  string      `json:"notifyType"`
	ProductKey  string      `json:"productKey"`
	Sn          string      `json:"sn"`
	VersionName string      `json:"versionName"`
	MessageID   string      `json:"messageId"`
	Time        Time        `json:"time"`
	Data        interface{} `json:"data"`
}

type DsDeviceActionData

type DsDeviceActionData struct {
	ActionCode string
	Params     map[string]interface{}
}

type DsDeviceAddData

type DsDeviceAddData struct {
	Name   string
	Remark string
}

type DsSerialNetData

type DsSerialNetData struct {
	Data    string
	DataLen int32
}

type DsSimulatorSendData

type DsSimulatorSendData struct {
	Content string
	Binary  bool
}

type DsUpgradeData

type DsUpgradeData struct {
	UpgradeID string
	Firmsoft  *FirmsoftInfo
	File      *os.File
	SnList    []string
}

type DsUpgradeInData

type DsUpgradeInData struct {
	UpgradeID string
	Firmsoft  *FirmsoftInfo
	SnList    []interface{}
}

type FirmsoftInfo

type FirmsoftInfo struct {
	FirmsoftID string
	Name       string
	Version    string
	SignAlgo   string
	Sign       string
}

type IotHubMessage

type IotHubMessage interface {
	http.Handler
	RegisterMessageHandler(handler IotHubMessageHandler)
	UnregisterMessageHandler(notifyType string)
}

func NewIotHubMessage

func NewIotHubMessage(cfg config.Config, log *zap.Logger, request req.Request, dalInfoService service.DalInfoService) IotHubMessage

type IotHubMessageHandler

type IotHubMessageHandler interface {
	NotifyType() string
	Handle(downstream *Downstream) error
}

func NewCheckStatusHandler

func NewCheckStatusHandler(dalInfoService service.DalInfoService) IotHubMessageHandler

type Time

type Time time.Time

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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