Documentation ¶
Index ¶
- Constants
- Variables
- func AuthUrl(host string) string
- func BindAppUrl(host, productKey, sn, appId string) string
- func DownloadFirmwareUrl(host, productKey, firmsoftId string) string
- func RefreshTokenUrl(host string) string
- func ReportCmdResultUrl(host, productKey, sn string) string
- func ReportEventUrl(host, productKey, sn string) string
- func ReportGwTopologyUrl(host string) string
- func ReportStatusUrl(host, productKey, sn string) string
- func ReportUpgradeProgressUrl(host, productKey, sn string) string
- func SubscribeUrl(host string) string
- type AuthResult
- type GwTopology
- type Request
- type ResponseBody
- type SubDevice
Constants ¶
View Source
const ( Ok = "OK" NotFound = "NOT_FOUND" PermissionDenied = "PERMISSION_DENIED" IllegalArgument = "ILLEGAL_ARGUMENT" Failed = "FAILED" Occupy = "OCCUPY" InvalidAccessToken = "INVALID_ACCESS_TOKEN" )
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewRequest)
Functions ¶
func BindAppUrl ¶
func DownloadFirmwareUrl ¶
func RefreshTokenUrl ¶
func ReportCmdResultUrl ¶
func ReportEventUrl ¶
func ReportGwTopologyUrl ¶
func ReportStatusUrl ¶
func SubscribeUrl ¶
Types ¶
type AuthResult ¶
type AuthResult struct { ResponseBody Body authResultBody `json:"body"` }
type GwTopology ¶
type Request ¶
type Request interface { Auth(ctx context.Context, dalId string) *AuthResult RefreshToken(ctx context.Context, dalId string, refreshToken string) *AuthResult BindApp(ctx context.Context, dalId, productKey, appId, sn string) (err error) SetCallbackUrl(ctx context.Context, dalId, serverUrl string) (err error) ReportCmdResultWithoutParams(ctx context.Context, dalId, productKey, sn, messageId, result string, time time.Time, remark string) (err error) ReportCmdResult(ctx context.Context, dalId, productKey, sn, messageId, result string, time time.Time, remark string, states map[string]interface{}) (err error) ReportStatus(ctx context.Context, dalId, productKey, sn string, states map[string]interface{}, time time.Time) (err error) ReportEvent(ctx context.Context, dalId, productKey, sn, reportId, eventCode string, params map[string]interface{}, time time.Time) (err error) ReportUpgradeProgress(ctx context.Context, dalId, productKey, sn, upgradeId, status string, progress int, remark string, time time.Time) (err error) ReportGwTopology(ctx context.Context, dalId string, gwTopology *GwTopology) (err error) ReportSerialNet(ctx context.Context, dalId, productKey, sn, reportId, data string, time time.Time, params map[string]interface{}) (err error) }
func NewRequest ¶
func NewRequest(cfg config.Config, log *zap.Logger, dalInfoService service.DalInfoService, reportService service.ReportService) Request
type ResponseBody ¶
type ResponseBody struct { Code string `json:"code"` ErrCode interface{} `json:"errCode"` Message string `json:"message"` Body interface{} `json:"body"` }
func BuildResponseFailed ¶
func BuildResponseFailed() *ResponseBody
func BuildResponseIllegalArgument ¶
func BuildResponseIllegalArgument() *ResponseBody
func BuildResponseNotFound ¶
func BuildResponseNotFound() *ResponseBody
func BuildResponseOk ¶
func BuildResponseOk() *ResponseBody
func (*ResponseBody) GetErrCode ¶ added in v0.5.2
func (resp *ResponseBody) GetErrCode() int32
func (*ResponseBody) SetBody ¶
func (resp *ResponseBody) SetBody(body interface{}) *ResponseBody
func (*ResponseBody) SetMessage ¶
func (resp *ResponseBody) SetMessage(message string) *ResponseBody
Click to show internal directories.
Click to hide internal directories.