dic

package
v1.6.4-0...-ed49831 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pd

func Pd(dic *DicTools, path, str string) bool

Types

type Build

type Build struct {
	G_v  *dto.Val
	V    *dto.Val
	Path string
}

build

type Dic

type Dic struct {
	G_V *dto.Val
	V   *dto.Val

	Path      string
	CacheName string
	Cache     bool
	FuncText  []*dto.BuildDic
	ClassText map[string]*dto.DicClass
	// contains filtered or unexported fields
}

func NewDic

func NewDic(text, trigger, path string) *Dic

func (*Dic) Run

func (D *Dic) Run() string

运行词库(全局变量,词库文本,触发)

func (*Dic) SetGlobal_v

func (D *Dic) SetGlobal_v(v *dto.Val) *Dic

func (*Dic) Set_v

func (D *Dic) Set_v(v *dto.Val) *Dic

type DicEntry

type DicEntry struct {
	// 返回信息
	Output  *dto.SingleValue
	Text    []string
	G_v     *dto.Val
	V       *dto.Val
	Sys_v   *dto.LocalDicValue
	Trigger bool
	Path    string
	Dic     *dto.BuildValue
}

run

func NewRunDicEntry

func NewRunDicEntry(path string) *DicEntry

执行词库

func (*DicEntry) CloseTrigger

func (r *DicEntry) CloseTrigger() *DicEntry

func (*DicEntry) OpenTrigger

func (r *DicEntry) OpenTrigger()

func (*DicEntry) Run

func (r *DicEntry) Run() string

执行

func (*DicEntry) SetDic

func (r *DicEntry) SetDic(s *dto.BuildValue) *DicEntry

设置词库信息

func (*DicEntry) SetDic_v

func (r *DicEntry) SetDic_v(v *dto.BuildValue) *DicEntry

继承词库变量

func (*DicEntry) SetGlobal_v

func (r *DicEntry) SetGlobal_v(v *dto.Val) *DicEntry

设置全局变量

func (*DicEntry) SetPath

func (r *DicEntry) SetPath(s string) *DicEntry

设置全局路径

func (*DicEntry) SetRunFor

func (r *DicEntry) SetRunFor() *DicEntry

设置在循环中

func (*DicEntry) SetRunIf

func (r *DicEntry) SetRunIf() *DicEntry

设置在判断中

func (*DicEntry) SetText

func (r *DicEntry) SetText(s []string) *DicEntry

设置词库文本

func (*DicEntry) Set_v

func (r *DicEntry) Set_v(v *dto.Val) *DicEntry

设置局部变量

type DicFunc

type DicFunc struct {
	// 套娃
	Open bool
	// 全局变量
	GV *dto.Val
	// 局部变量
	V *dto.Val
	// 系统变量
	Sys *dto.LocalDicValue
	// 全局路径
	Path string
	// 准备输出内容
	Output *dto.SingleValue
	Dic    *dto.BuildValue
}

func

type DicTools

type DicTools struct {
	Func           *DicFunc
	GlobalVariable *dto.Val
	LocalVariable  *dto.Val
}

常用结构

type IfText

type IfText struct{}

if

func (*IfText) Evaluate

func (it *IfText) Evaluate(dic *DicTools, path string, parsed []map[string]string) string

func (*IfText) EvaluateExpression

func (it *IfText) EvaluateExpression(expression string) bool

评估一个表达式的真假值

func (*IfText) Run

func (it *IfText) Run(input string) []map[string]string

type PostFile

type PostFile struct {
	Name string `json:"name"`
	Size int64  `json:"size"`
	Data string `json:"data"`
}

type RequestInfo

type RequestInfo struct {
	Path        string                 `json:"路径"`
	Type        string                 `json:"来源"`
	QueryParams url.Values             `json:"GET,omitempty"`
	Headers     http.Header            `json:"请求头"`
	IP          string                 `json:"IP"`
	Host        string                 `json:"Host"`
	Post        interface{}            `json:"POST,omitempty"`
	PostFile    map[string][]*PostFile `json:"POSTFile,omitempty"`
}

type ServeRouter

type ServeRouter struct {
	Ws       bool
	WsConfig *websocket.Upgrader
	Cache    bool
	// contains filtered or unexported fields
}

func (*ServeRouter) WebRun

func (s *ServeRouter) WebRun(w http.ResponseWriter, r *http.Request)

路由

type SetCookie

type SetCookie struct {
	Name     string `json:"命名"`
	Value    string `json:"数据"`
	Path     string `json:"路径"`
	HttpOnly bool   `json:"禁止JS"`
	MaxAge   int    `json:"存活"`
}

type WebDic

type WebDic struct {
	Text string
	G_V  *dto.Val
	V    *dto.Val
	Path string
}

func NewWebDic

func NewWebDic(text, path string) *WebDic

func (*WebDic) Run

func (WD *WebDic) Run() string

运行网页词库

func (*WebDic) SetGlobal_v

func (WD *WebDic) SetGlobal_v(v *dto.Val) *WebDic

func (*WebDic) Set_v

func (WD *WebDic) Set_v(v *dto.Val) *WebDic

Jump to

Keyboard shortcuts

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