Documentation
¶
Index ¶
- Constants
- Variables
- func GOPATH() (gopath string, has bool)
- func GOROOT() (goroot string, has bool)
- func LatestVersion(path string) (v string, err error)
- func LatestVersionFromProxy(path string) (v string, err error)
- func PKG() (pkg string)
- func RegisterBuiltinType(typ *Type)
- type Annotation
- type Annotations
- type Component
- type Components
- type DepResult
- type DepVersion
- type Function
- func (f *Function) Annotation(name string) (params []string, has bool)
- func (f *Function) Authorization() (ok bool)
- func (f *Function) Barrier() (ok bool)
- func (f *Function) Cache() (cmd string, ttl string, has bool)
- func (f *Function) CacheControl() (maxAge int, public bool, mustRevalidate bool, proxyRevalidate bool, has bool, ...)
- func (f *Function) Deprecated() (ok bool)
- func (f *Function) Description() (description string)
- func (f *Function) Errors() (errs string)
- func (f *Function) FieldImports() (v Imports)
- func (f *Function) ForeachAnnotations(fn func(name string, params []string))
- func (f *Function) Handle(ctx context.Context) (result interface{}, err error)
- func (f *Function) HostServiceName() (name string)
- func (f *Function) Internal() (ok bool)
- func (f *Function) Metric() (ok bool)
- func (f *Function) Name() (name string)
- func (f *Function) Parse(ctx context.Context) (err error)
- func (f *Function) Permission() (ok bool)
- func (f *Function) Readonly() (ok bool)
- func (f *Function) Title() (title string)
- func (f *Function) Validation() (title string, ok bool)
- type FunctionError
- type FunctionField
- type Functions
- type Import
- type Imports
- type Module
- func (mod *Module) GetType(path string, name string) (typ *Type, has bool)
- func (mod *Module) Parse(ctx context.Context) (err error)
- func (mod *Module) ParseType(ctx context.Context, path string, name string) (typ *Type, err error)
- func (mod *Module) Services() (services Services, err error)
- func (mod *Module) String() (s string)
- func (mod *Module) Types() (types map[string]*Type)
- type Requires
- type Service
- type Services
- type SourceDirReader
- type SourceFile
- type Sources
- func (sources *Sources) FindFileInDir(path string, matcher func(file *ast.File) (ok bool)) (file *ast.File, err error)
- func (sources *Sources) FindTypeSpec(path string, name string) (spec *ast.TypeSpec, imports Imports, genericDoc string, err error)
- func (sources *Sources) ReadDir(path string, fn func(file *ast.File, filename string) (err error)) (err error)
- func (sources *Sources) ReadFile(path string, name string) (file *ast.File, filename string, err error)
- type Type
- type TypeKind
- type TypeParadigm
- type TypeScope
- type Types
- type Work
Constants ¶
View Source
const ( BasicKind = TypeKind(iota + 1) // 基本类型,oas时不需要ref BuiltinKind // 内置类型,oas时需要ref,但不需要建component IdentKind InterfaceKind StructKind StructFieldKind PointerKind ArrayKind MapKind AnyKind ParadigmKind ParadigmElementKind ReferenceKind )
Variables ¶
Functions ¶
func LatestVersion ¶
func LatestVersionFromProxy ¶
func RegisterBuiltinType ¶
func RegisterBuiltinType(typ *Type)
Types ¶
type Annotation ¶
func NewAnnotation ¶
func NewAnnotation(name string, params ...string) Annotation
type Annotations ¶
type Annotations []Annotation
func ParseAnnotations ¶
func ParseAnnotations(s string) (annotations Annotations, err error)
func (*Annotations) Add ¶
func (annotations *Annotations) Add(name string, param string)
func (*Annotations) FirstParam ¶
func (annotations *Annotations) FirstParam(name string) (value string, has bool)
func (*Annotations) Get ¶
func (annotations *Annotations) Get(name string) (annotation Annotation, has bool)
func (*Annotations) Set ¶
func (annotations *Annotations) Set(name string, param string)
type Components ¶
type Components []*Component
func (Components) Len ¶
func (components Components) Len() int
func (Components) Less ¶
func (components Components) Less(i, j int) bool
func (Components) Swap ¶
func (components Components) Swap(i, j int)
type DepResult ¶
type DepResult struct {
Version DepVersion `json:"version"`
}
type DepVersion ¶
type DepVersion struct {
Version string `json:"version"`
}
type Function ¶
type Function struct {
Ident string
ConstIdent string
ProxyIdent string
HandlerIdent string
Annotations Annotations
Param *FunctionField
Result *FunctionField
// contains filtered or unexported fields
}
func (*Function) Annotation ¶
func (*Function) Authorization ¶
func (*Function) CacheControl ¶
func (*Function) Deprecated ¶
func (*Function) Description ¶
func (*Function) FieldImports ¶
func (*Function) ForeachAnnotations ¶
func (*Function) HostServiceName ¶
func (*Function) Permission ¶
func (*Function) Validation ¶
type FunctionError ¶
type FunctionField ¶
func (*FunctionField) Paths ¶
func (sf *FunctionField) Paths() (paths []string)
func (*FunctionField) String ¶
func (sf *FunctionField) String() (v string)
type Module ¶
type Module struct {
Dir string
Path string
Version string
Requires Requires
Work *Work
Replace *Module
// contains filtered or unexported fields
}
type SourceDirReader ¶
type SourceDirReader struct {
// contains filtered or unexported fields
}
type SourceFile ¶
type SourceFile struct {
// contains filtered or unexported fields
}
type Sources ¶
type Sources struct {
// contains filtered or unexported fields
}
func (*Sources) FindFileInDir ¶
func (*Sources) FindTypeSpec ¶
type Type ¶
type Type struct {
Kind TypeKind
Path string
Name string
Annotations Annotations
Paradigms []*TypeParadigm
Tags map[string]string
Elements []*Type
ParadigmsPacked *Type
}
func (*Type) GetTopPaths ¶
type TypeParadigm ¶
func (*TypeParadigm) String ¶
func (tp *TypeParadigm) String() (v string)
Click to show internal directories.
Click to hide internal directories.