Documentation ¶
Index ¶
- Constants
- func AutoType(k, v string) (typ string, val any)
- func GetKind(result string) int
- func In(ls []string, v string) bool
- func JsonDump(v any, indent string) string
- func NameSlice(s string) (name string, args []string)
- func NoFlag() bool
- func YamlDump(v any) string
- type Api
- type File
- type Include
- type Lexer
- type Parser
- func (p *Parser) Export(cmds ...string) (files []File)
- func (p *Parser) GetDir() string
- func (p *Parser) IsType() (*Sentence, bool)
- func (p *Parser) Match()
- func (p *Parser) MatchApi(typ string) error
- func (p *Parser) MatchArgs() (args []string, kind int)
- func (p *Parser) MatchImport() (*Include, error)
- func (p *Parser) MatchLength() (err error)
- func (p *Parser) MatchList() (err error)
- func (p *Parser) MatchType() error
- func (p *Parser) MatchVar(typ string) *Sentence
- func (p *Parser) NewExt(ext string) string
- type Plugin
- type Scanner
- type Sentence
- func (sentence *Sentence) Add(typ, name, hint, value string, args []string, vt map[string]*Sentence, ...) *Sentence
- func (sentence *Sentence) Find(arg string) int
- func (sentence *Sentence) IsApi() bool
- func (sentence *Sentence) IsBrace() bool
- func (sentence *Sentence) IsBracket() bool
- func (sentence *Sentence) IsConstant() bool
- func (sentence *Sentence) IsDict() bool
- func (sentence *Sentence) IsEnum() bool
- func (sentence *Sentence) IsGroup() bool
- func (sentence *Sentence) IsList() bool
- func (sentence *Sentence) IsOpen() bool
- func (sentence *Sentence) IsOptional() bool
- func (sentence *Sentence) IsRequired() bool
- func (sentence *Sentence) Pop(name string) *Sentence
- func (sentence *Sentence) SetOutput(val any)
- func (sentence *Sentence) ToDict() map[string]string
- type Token
Constants ¶
View Source
const ( NUMBER = iota + 4 // number STRING // string COMMA // , LBRACKET // [ RBRACKET // ] LBRACE // { RBRACE // } LANGLE // < RANGLE // > LGROUP // ( RGROUP // ) AUTO // auto NUM // num STR // str TYPE // type REQUIRED // required OPTIONAL // optional DEPRECATE // deprecate GET // get method POST // post method OPTION // option method PUT // put method DELETE // delete method HEAD // head method PATCH // patch method BOOL // bool FROM // from IMPORT // import COLON // : IDENTIFIER // identifier ASSIGNMENT // = )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Api ¶
type Api struct { // 接口地址 Url string `json:"url" yaml:"url"` // 请求方式 Method string `json:"method" yaml:"method"` // 函数简介 Hint string `json:"comment,omitempty" yaml:"comment,omitempty"` // 函数名 Function string `json:"function,omitempty" yaml:"function,omitempty"` // 接口描述 Info *Sentence `json:"-" yaml:"-"` // 接口载荷 Data *Sentence `json:"data,omitempty" yaml:"data,omitempty"` // 接口参数 Params *Sentence `json:"params,omitempty" yaml:"params,omitempty"` // 接口请求头 Headers *Sentence `json:"headers,omitempty" yaml:"headers,omitempty"` // 接口文本 Cookies *Sentence `json:"cookies,omitempty" yaml:"cookies,omitempty"` // 接口返回 Response *Sentence `json:"response,omitempty" yaml:"response,omitempty"` }
请求任务
type Include ¶
type Include struct {
// contains filtered or unexported fields
}
导入
func NewInclude ¶
type Parser ¶
type Parser struct { // 词法分析器 *Lexer // 变量类型 Types map[string]*Sentence // Api 字典 Output map[string]*Api // contains filtered or unexported fields }
语法分析器
type Plugin ¶ added in v0.2.0
type Sentence ¶
type Sentence struct { Type string `json:"type,omitempty" yaml:"type,omitempty"` Name string `json:"-" yaml:"-"` Hint string `json:"hint,omitempty" yaml:"hint,omitempty"` Value string `json:"-" yaml:"-"` Args []string `json:"-" yaml:"-"` Length int64 `json:"length,omitempty" yaml:"length,omitempty"` Output any `json:"value,omitempty" yaml:"value,omitempty"` List []*Sentence `json:"-" yaml:"-"` Map map[string]*Sentence `json:"-" yaml:"-"` // contains filtered or unexported fields }
单条语句
其中 Args 表示其 Name 中携带的参数
当该语句为字典时 Map 不为空 表示其下包含的语句
Source Files ¶
Click to show internal directories.
Click to hide internal directories.