parser

package
v1.2.17 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API added in v1.2.3

type API struct {
	Common
	Roles   []string
	Auth    []string
	Version string
	Path    string
	Func    string
	Table   string
	Method  string
	Cache   uint64
	Params  []*Param
	Return  *Return
}

API defined TODO

type AppParser

type AppParser struct {
	*Application
}

AppParser defined AppParser struct

func New

func New() *AppParser

New defined AppParser

func NewTpl

func NewTpl(name string, pkg string) *AppParser

NewTpl defined AppParser

func (*AppParser) Marshal

func (parser *AppParser) Marshal() []byte

Marshal marshal XML to string

func (*AppParser) MarshalIndent

func (parser *AppParser) MarshalIndent(prefix, indent string) []byte

MarshalIndent marshal XML to string

func (*AppParser) Walk

func (parser *AppParser) Walk(xmlPath string) error

Walk parse all xml in directory

func (*AppParser) WalkXML

func (parser *AppParser) WalkXML(files ...string) error

WalkXML parse all xml in directory

type Application added in v1.2.3

type Application struct {
	Common
	PackageName string `validate:"required"`
	Controllers []*Controller
	Beans       []*Bean
	Tables      []*Table
}

Application defined TODO

type Bean added in v1.2.3

type Bean struct {
	Common
	Packages string
	Props    []*Prop
	Extends  string
}

Bean defined TODO

type Column added in v1.2.3

type Column struct {
	Common
	Type    string
	Xorm    string
	JSON    string
	Form    string
	Example string
}

Column defined TODO

type Common added in v1.2.3

type Common struct {
	Name string `validate:"required"`
	Desc string `validate:"required"`
	Path string
}

Common defined TODO

func (*Common) APIPath added in v1.2.3

func (c *Common) APIPath(ctrName, apiName, apiPath string) string

APIPath api path

func (*Common) APIPrefix added in v1.2.3

func (c *Common) APIPrefix(v string) string

APIPrefix version path

func (*Common) AutoIncr added in v1.2.3

func (c *Common) AutoIncr(tables []*Table, tableName string) (fields []string)

AutoIncr defined

func (*Common) Contains added in v1.2.3

func (c *Common) Contains(args []string, s string) bool

Contains defined

func (*Common) FormatString added in v1.2.3

func (c *Common) FormatString(args []string, segm string) template.HTML

FormatString defined

func (*Common) ISArray added in v1.2.3

func (c *Common) ISArray(m string) bool

ISArray defined isarray

func (*Common) Import added in v1.2.3

func (c *Common) Import(pkgs ...string) template.HTML

Import packages

func (*Common) LcFirst added in v1.2.3

func (c *Common) LcFirst(str string) string

LcFirst first word

func (*Common) ORef added in v1.2.3

func (c *Common) ORef(m string) string

ORef defined model name

func (*Common) PRef added in v1.2.3

func (c *Common) PRef(m string) string

PRef defined model name

func (*Common) Ref added in v1.2.3

func (c *Common) Ref(m string) string

Ref defined model name

func (*Common) SQLDelOne added in v1.2.3

func (c *Common) SQLDelOne(table Table, name string) string

SQLDelOne remove one

func (*Common) SQLInsertOne added in v1.2.3

func (c *Common) SQLInsertOne(table Table, name string) string

SQLInsertOne insert one

func (*Common) SQLSelectAll added in v1.2.3

func (c *Common) SQLSelectAll(table Table, name string) string

SQLSelectAll select one

func (*Common) SQLSelectOne added in v1.2.3

func (c *Common) SQLSelectOne(table Table, name string) string

SQLSelectOne select one

func (*Common) SQLUpdateOne added in v1.2.3

func (c *Common) SQLUpdateOne(table Table, name string) string

SQLUpdateOne update one

func (*Common) SRef added in v1.2.3

func (c *Common) SRef(m string) string

SRef defined model name

func (*Common) SplitExtends added in v1.2.3

func (c *Common) SplitExtends(parent string) []string

SplitExtends extends model,bean

func (*Common) TableName added in v1.2.3

func (c *Common) TableName(app string, table string) string

TableName defined table

func (*Common) TableNameOfType added in v1.2.3

func (c *Common) TableNameOfType(t string) string

TableNameOfType defined

func (*Common) Title added in v1.2.3

func (c *Common) Title(str string) string

Title first word

func (*Common) ToTitle added in v1.2.3

func (c *Common) ToTitle(title string) string

ToTitle title

func (*Common) ToTypeValue added in v1.2.3

func (c *Common) ToTypeValue(t string, v string) template.HTML

ToTypeValue value

func (*Common) ToUpper added in v1.2.3

func (c *Common) ToUpper(name string) string

ToUpper toUpper

func (*Common) ToUpperCase added in v1.2.3

func (c *Common) ToUpperCase(name string) string

ToUpperCase uppercase

func (*Common) TypeWithPointer added in v1.2.3

func (c *Common) TypeWithPointer(m string) string

TypeWithPointer defined model name

func (*Common) UcFirst added in v1.2.3

func (c *Common) UcFirst(str string) string

UcFirst first word

func (*Common) Unescaped added in v1.2.3

func (c *Common) Unescaped(x string) template.HTML

Unescaped unescaped

type Controller added in v1.2.3

type Controller struct {
	Common
	APIS   []*API
	Prefix string
}

Controller defined TODO

type Failure added in v1.2.3

type Failure struct {
	Common
	Type string
}

Failure defined TODO

type Overlap added in v1.2.3

type Overlap int

Overlap int

const (
	OverlapSkip Overlap = iota + 1
	OverlapWrite
	OverlapInc
)

OverlapSkip Overlap

type Param added in v1.2.3

type Param struct {
	Common
	Type  string
	Value string
}

Param defined TODO

type Pipe added in v1.2.3

type Pipe interface {
	Pre(*AppParser) error
	After(*AppParser, []*TmplCfg) error
	Name() string
	Build(string, []string, *AppParser) ([]*TmplCfg, error)
}

Pipe interface

type Prop added in v1.2.3

type Prop struct {
	Common
	Type    string
	JSON    string
	Form    string
	Example string
}

Prop defined TODO

type RPC added in v1.2.3

type RPC struct {
	Common
	Request *Request
	Reply   *Reply
}

RPC defined TODO

type Reply added in v1.2.3

type Reply struct {
	Common
	Type string
}

Reply defined TODO

type Request added in v1.2.3

type Request struct {
	Common
	Type string
}

Request defined TODO

type Return added in v1.2.3

type Return struct {
	Common
	Success *Success
	Failure *Failure
}

Return defined TODO

type Success added in v1.2.3

type Success struct {
	Common
	Type string
}

Success defined TODO

type Table added in v1.2.3

type Table struct {
	Common
	Bind     string
	Packages string
	Columns  []*Column
	Extends  string
}

Table defined TODO

type TmplCfg added in v1.2.3

type TmplCfg struct {
	Text     string
	FilePath string
	Data     interface{}
	Overlap  Overlap
	GOFmt    bool
	GOProto  bool
	Format   func(string) string
}

TmplCfg struct

Jump to

Keyboard shortcuts

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