protocol

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeIThings = "iThings" //默认协议
)

Variables

This section is empty.

Functions

func Check

func Check(fields ConfigFields, infos ConfigInfos) error

Types

type ConfigField

type ConfigField struct {
	ID         int64  `json:"id"`
	Group      string `json:"group"`      //分组(不传为默认)
	Key        string `json:"key"`        //配置文件里的关键字
	Label      string `json:"label"`      //展示名称
	IsRequired bool   `json:"isRequired"` //是否必填
	Sort       int64  `json:"sort"`       //排序
}

type ConfigFields

type ConfigFields []*ConfigField

type ConfigInfo

type ConfigInfo struct {
	ID     int64             `json:"id"`
	Config map[string]string `json:"config"` //协议配置内容,key要从protocolInfo的ConfigKeys里拿
	Desc   string            `json:"desc"`   // 描述
}

自定义协议的配置表

type ConfigInfos

type ConfigInfos []*ConfigInfo

func (ConfigInfos) ToPubStu

func (c ConfigInfos) ToPubStu() (ret []map[string]string)

Jump to

Keyboard shortcuts

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