代码拉取完成,页面将自动刷新
package main
import (
"encoding/json"
"strconv"
"strings"
)
// Bytes type wrapper for json bytes
type Bytes struct {
Data []byte
}
// UnmarshalJSON implemnents json interface
func (b *Bytes) UnmarshalJSON(data []byte) error {
d := []byte{}
s := strings.Trim(string(data), `, "`)
bs := strings.Split(s, ",")
for _, b := range bs {
value, err := strconv.ParseUint(b, 0, 8)
if err != nil {
return err
}
bval := byte(value)
d = append(d, bval)
}
b.Data = d
return nil
}
// ParserConfig parser config
type ParserConfig struct {
Type string `json:"type,omitempty"`
Head Bytes `json:"head,omitempty"`
Items []ParserItem `json:"items,omitempty"`
}
// SlotItem slot item
type SlotItem struct {
Kind string `json:"kind,omitempty"`
Type string `json:"type,omitempty"`
Path string `json:"path,omitempty"`
Width int `json:"width,omitempty"`
Scale string `json:"scale,omitempty"`
Value string `json:"value,omitempty"`
Max float64 `json:"max,omitempty"`
Min float64 `json:"min,omitempty"`
}
// SlotConfig slot config
type SlotConfig struct {
Head Bytes `json:"head,omitempty"`
Items []SlotItem `json:"items,omitempty"`
}
// SourceConfig source config
type SourceConfig struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
Options json.RawMessage `json:"options,omitempty"`
}
// Config config container
type Config struct {
Sources []SourceConfig `json:"sources,omitempty"`
Parsers []ParserConfig `json:"parsers,omitempty"`
Slots []SlotConfig `json:"slots,omitempty"`
BeidouSenderConfig BeidouSenderConfig `json:"beidouSender,omitempty"`
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。