Documentation
¶
Index ¶
- Variables
- type Component
- type Field
- type FileSet
- type Fn
- func (f *Fn) Description() (v string)
- func (f *Fn) GetPermissions() (roles []string, v bool)
- func (f *Fn) HasAuthorization() (v bool)
- func (f *Fn) HasDeprecated() (v bool)
- func (f *Fn) HasParam() (v bool)
- func (f *Fn) HasResult() (v bool)
- func (f *Fn) HasTx() (kind string, opts []string, has bool)
- func (f *Fn) HasValidate() (v bool)
- func (f *Fn) IsInternal() (v bool)
- func (f *Fn) Name() (v string)
- func (f *Fn) NameToConstName() (v string, err error)
- func (f *Fn) NameToProxyName() (v string, err error)
- func (f *Fn) Title() (v string)
- type FnField
- type Import
- type Imports
- type Module
- func (mod *Module) CreatedPackageInfos() (infos []*loader.PackageInfo)
- func (mod *Module) FileInfo(f *ast.File) (v *token.File)
- func (mod *Module) FindDeps(pkgPath string) (deps map[string]*Module, err error)
- func (mod *Module) GetPackageOfFile(f *ast.File) (name string, ident string, has bool)
- func (mod *Module) GetStruct(pkg string, name string) (v *Struct, has bool)
- func (mod *Module) SetStruct(v *Struct)
- func (mod Module) String() (s string)
- type Project
- type Require
- type Service
- func (svc *Service) AddComponent(c *Component) (err error)
- func (svc *Service) AddFn(fn *Fn) (err error)
- func (svc *Service) Description() (v string)
- func (svc *Service) Fns() (v []*Fn)
- func (svc *Service) Internal() (v bool)
- func (svc *Service) Name() (v string)
- func (svc *Service) Title() (v string)
- type Struct
- type Type
- func (t *Type) Annotations() (v map[string]string)
- func (t *Type) CodeString() (v string)
- func (t *Type) GetImport() (v *Import, has bool)
- func (t *Type) HasStruct() bool
- func (t *Type) IsArray() bool
- func (t *Type) IsBuiltin() bool
- func (t *Type) IsFnsCodeError() bool
- func (t *Type) IsFnsContext() bool
- func (t *Type) IsFnsEmpty() bool
- func (t *Type) IsFnsJsonArray() bool
- func (t *Type) IsFnsJsonDate() bool
- func (t *Type) IsFnsJsonObject() bool
- func (t *Type) IsFnsJsonRawMessage() bool
- func (t *Type) IsFnsJsonTime() bool
- func (t *Type) IsJsonRawMessage() bool
- func (t *Type) IsMap() bool
- func (t *Type) IsStar() bool
- func (t *Type) IsStruct() bool
- func (t *Type) IsTime() bool
- func (t *Type) ObjectKey() (v string)
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cli.Command{ Name: "codes", Aliases: nil, Usage: "codes {project path}", Description: "scan fns project and generate fn codes", ArgsUsage: "", Category: "", Action: func(ctx *cli.Context) (err error) { projectDir := strings.TrimSpace(ctx.Args().First()) if projectDir == "" { projectDir = "." } projectDir, err = filepath.Abs(projectDir) if err != nil { err = fmt.Errorf("fnc: codes failed for project path is invalid, %v", err) return } debug := ctx.Bool("debug") p, pErr := NewProject(projectDir, debug) if pErr != nil { err = pErr return } scanErr := p.Scan() if scanErr != nil { err = scanErr return } generateErr := p.Generate() if generateErr != nil { err = generateErr return } return }, Flags: []cli.Flag{ &cli.BoolFlag{ Name: "debug", EnvVars: []string{"FNC_DEBUG"}, Usage: "print debug infos", Required: false, }, }, }
Functions ¶
This section is empty.
Types ¶
type Fn ¶
func (*Fn) Description ¶
func (*Fn) GetPermissions ¶ added in v1.10.0
func (*Fn) HasAuthorization ¶
func (*Fn) HasDeprecated ¶
func (*Fn) HasValidate ¶
func (*Fn) IsInternal ¶ added in v1.3.0
func (*Fn) NameToConstName ¶
func (*Fn) NameToProxyName ¶
type FnField ¶
func (*FnField) Description ¶
type Imports ¶
type Imports []*Import
func NewImports ¶
func (Imports) FindByAlias ¶ added in v1.8.0
type Module ¶
type Module struct {
Name string
Path string
GoVersion string
Requires []Require
Program *loader.Program
Deps map[string]*Module
Structs map[string]*Struct
}
func (*Module) CreatedPackageInfos ¶
func (mod *Module) CreatedPackageInfos() (infos []*loader.PackageInfo)
func (*Module) GetPackageOfFile ¶
type Require ¶
type Service ¶
type Service struct {
DirPath string
Package string
PackagePath string
Imports Imports
Annotations map[string]string
Components map[string]*Component
// contains filtered or unexported fields
}
func (*Service) AddComponent ¶ added in v1.8.0
func (*Service) Description ¶
type Struct ¶
type Struct struct {
Package string
Name string
Fields []*Field
Annotations map[string]string
Ref bool
}
func (*Struct) Description ¶
type Type ¶
type Type struct {
Kind string
Indent string // built-in type name
Import *Import
Struct *Struct
X *Type // if map, x is key
Y *Type // if map, y is value
}
func (*Type) Annotations ¶
func (*Type) CodeString ¶
func (*Type) IsFnsCodeError ¶
func (*Type) IsFnsContext ¶
func (*Type) IsFnsEmpty ¶
func (*Type) IsFnsJsonArray ¶
func (*Type) IsFnsJsonDate ¶
func (*Type) IsFnsJsonObject ¶
func (*Type) IsFnsJsonRawMessage ¶
func (*Type) IsFnsJsonTime ¶
func (*Type) IsJsonRawMessage ¶
Click to show internal directories.
Click to hide internal directories.