Documentation ¶
Index ¶
Constants ¶
View Source
const (
CustomType = "custom" //自定义协议topic type定义
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConvertFunc ¶
type ConvertType ¶
type ConvertType int
const ( ConvertTypeUp ConvertType = iota //自定义协议转iThings协议 ConvertTypeDown //iThings协议转自定义协议 )
type Info ¶
type Info struct { ProductID string TransformScript *string //可能为空 ScriptLang int64 CustomTopic []string }
func (*Info) InitScript ¶
type Repo ¶
type Repo interface { // GetProtoFunc 自定义协议转iTHings协议 GetProtoFunc(ctx context.Context, productID string, dir ConvertType, handle string, Type string) (ConvertFunc, error) // GetTransFormFunc 自定义topic转换函数 GetTransFormFunc(ctx context.Context, productID string, direction devices.Direction) (TransFormFunc, error) // ClearCache 清除缓存 ClearCache(ctx context.Context, productID string) error }
type TransFormFunc ¶
type TransFormFunc func(topic string, data []byte) (*TransformRet, error)
type TransformRet ¶
Click to show internal directories.
Click to hide internal directories.