config

package
v1.1.23 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelegatorCfg

type DelegatorCfg struct {
	Target string `json:"target"` // 委托对象,可以为空,为空则使用root的委托对象
	Method string `json:"method"` // 委托方法
	Script string `json:"script"` // 委托脚本
}

DelegatorCfg 委托配置

type NodeCfg

type NodeCfg struct {
	ID         string          `json:"id"`         // 唯一ID
	Name       string          `json:"name"`       // 节点名
	Category   string          `json:"category"`   // 类型
	Title      string          `json:"title"`      // 描述
	Children   []string        `json:"children"`   // 孩子节点
	Properties json.RawMessage `json:"properties"` // 自定义属性,须由子类自行解析
	Delegator  DelegatorCfg    `json:"delegator"`  // 委托配置
}

NodeCfg 节点配置,也是默认解析器所能解析的格式

func (*NodeCfg) Valid

func (n *NodeCfg) Valid() error

type TreeCfg

type TreeCfg struct {
	Nodes       map[string]*NodeCfg `json:"nodes"`       // 所有节点
	Ver         string              `json:"ver"`         // 数据版本
	Root        string              `json:"root"`        // 根节点nanoID
	Tag         string              `json:"tag"`         // 行为树标志,必须能简要描述业务逻辑且全局唯一
	Description string              `json:"description"` // 业务逻辑详细描述
}

TreeCfg 树配置

func (*TreeCfg) Valid

func (c *TreeCfg) Valid() error

Jump to

Keyboard shortcuts

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