Documentation ¶
Index ¶
- Constants
- func GetNodePath(node *Node) string
- func GetSubData(d any, key string) (any, bool)
- func GetValueByNode(d any, node *Node) (any, bool)
- func InterfaceToUint64(d any) (uint64, bool)
- func RegisterParser(name string, parser Parser)
- func UnmarshalSubData(d any, path string, v any) error
- type BaseKV
- func (c *BaseKV) ConvertUint64(k string) uint64
- func (c *BaseKV) DeleteItem(k string)
- func (c *BaseKV) GetBool(k string) bool
- func (c *BaseKV) GetItem(k string) any
- func (c *BaseKV) GetString(k string) string
- func (c *BaseKV) GetUint64(k string) uint64
- func (c *BaseKV) Has(k string) bool
- func (c *BaseKV) SetItem(k string, v any)
- type BaseParser
- type BitReader
- type BitWriter
- type ConcatReader
- type Config
- type Node
- func GetNodeByPath(node *Node, key string) *Node
- func NewChildNodeTree(parent *Node, name string, data any, ctx *NodeContext) (*Node, error)
- func NewEmptyNode(name string, d any, cfg *Config, ctx *NodeContext) *Node
- func NewNodeTree(d yaml.MapSlice) (*Node, error)
- func NewNodeTreeWithConfig(parentCfg *Config, name string, data any, ctx *NodeContext) (*Node, error)
- func ParseRule(p string) (*Node, error)
- func (n *Node) AppendNode(node *Node) error
- func (n *Node) Copy() *Node
- func (n *Node) Generate(data any) error
- func (n *Node) GenerateSubNode(data any, path string) error
- func (n *Node) Parse(reader *BitReader) error
- func (n *Node) ParseSubNode(data *BitReader, path string) error
- func (n *Node) Result() (*NodeValue, error)
- type NodeConfigFun
- type NodeContext
- type NodeValue
- type Parser
Constants ¶
View Source
const ( CfgIsTerminal = "isTerminal" CfgIsList = "isList" CfgLength = "length" CfgType = "type" CfgGetResult = "get result" CfgRawResult = "raw result" CfgRootMap = "rootNodeMap" CfgEndian = "endian" CfgOperator = "operator" CfgInList = "inList" CfgParent = "parent" CfgDel = "del" CfgDelimiter = "delimiter" CfgImport = "import" CfgNodeResult = "node result" CfgLastNode = "last node" CfgOptionFuns = "options functions" )
Variables ¶
This section is empty.
Functions ¶
func GetNodePath ¶
func InterfaceToUint64 ¶
func RegisterParser ¶
Types ¶
type BaseKV ¶
type BaseKV struct {
// contains filtered or unexported fields
}
func (*BaseKV) ConvertUint64 ¶
func (*BaseKV) DeleteItem ¶
type BaseParser ¶
type BaseParser struct {
// contains filtered or unexported fields
}
type BitReader ¶
func NewBitReader ¶
type BitWriter ¶
func NewBitWriter ¶
type ConcatReader ¶
type ConcatReader struct {
// contains filtered or unexported fields
}
func NewConcatReader ¶
func NewConcatReader(readers ...io.Reader) *ConcatReader
type Config ¶
type Config struct {
BaseKV
}
func AppendConfig ¶
func CopyConfig ¶
func NewEmptyConfig ¶
func NewEmptyConfig() *Config
type Node ¶
type Node struct { Name string Origin any Children []*Node Cfg *Config Ctx *NodeContext }
func GetNodeByPath ¶
func NewChildNodeTree ¶
func NewEmptyNode ¶
func NewEmptyNode(name string, d any, cfg *Config, ctx *NodeContext) *Node
NewEmptyNode 默认初始化一个空节点
func NewNodeTree ¶
func NewNodeTreeWithConfig ¶
func (*Node) AppendNode ¶
func (n *Node) SetParentResultWriterByNode(node *Node) { nodeRes := node.Cfg.GetItem("resultWriter").(*NodeResult) n.Cfg.SetItem("parentResultWriter", func(d []byte, length uint64) error { return nodeRes.Write(d, length) }) }
type NodeConfigFun ¶
type NodeConfigFun func(config *Config)
type NodeContext ¶
type NodeContext struct {
BaseKV
}
Click to show internal directories.
Click to hide internal directories.