Documentation ¶
Index ¶
- Constants
- func SkipImpls(fn func(_ string) bool)
- func TargetImpls(fn func(_ string) bool)
- type AstTree
- type BaseAstTree
- type BffAnnotationType
- type BffImpl
- type BffInterfaceAnnotation
- type BffInterfaceTree
- type BffItem
- type BffRequestAnnotation
- type BffRequestTree
- type BffResponseAnnotation
- type BffResponseTree
- type BffTree
- type Bffs
- func (bff Bffs) BffIter(iterFn func(item *BffItem) bool)
- func (bff Bffs) ImplIter(iterFn func(*BffItem, *BffImpl) bool)
- func (bff Bffs) MatchBff(fileNode types.FileNode) *BffItem
- func (bff Bffs) MatchBffByName(bffName string) *BffItem
- func (bff Bffs) MatchBffImplByName(bffName, implName string) *BffImpl
- func (bff Bffs) MatchBffImplByPath(fileNode types.FileNode) *BffImpl
- type DepsEnv
- type ExtendTree
- type MakeFileParam
- type ServiceAnnotationType
- type ServiceInterfaceAnnotation
- type ServiceInterfaceTree
- type ServiceRequestAnnotation
- type ServiceRequestTree
- type ServiceResponseAnnotation
- type ServiceResponseTree
- type ServiceTree
- type SystemDes
Constants ¶
View Source
const ( TypeBffAnnotationType = "type" NameBffAnnotationType = "name" LoginBffAnnotationType = "login" PageBffAnnotationType = "page" URIBffAnnotationType = "uri" DesBffAnnotationType = "describe" InterfaceBffAnnotationType = "interface" )
View Source
const ( TypeServiceAnnotationType = "type" PathServiceAnnotationType = "path" DesServiceAnnotationType = "des" )
View Source
const ( SystemNameSubffix = "-system" ProtocolName = "protocol" GoHostPreffix = "git.gmtshenzhen.com/yaodao" )
Variables ¶
This section is empty.
Functions ¶
func TargetImpls ¶
Types ¶
type AstTree ¶
type AstTree interface { Parse() error ParseAnnotation(doc *ast.CommentGroup) error FillCrossStructs() error }
type BaseAstTree ¶
type BaseAstTree struct{}
func NewBaseAstTree ¶
func NewBaseAstTree() *BaseAstTree
func (*BaseAstTree) FillCrossStructs ¶
func (base *BaseAstTree) FillCrossStructs() error
func (*BaseAstTree) Parse ¶
func (base *BaseAstTree) Parse() error
func (*BaseAstTree) ParseAnnotation ¶
func (base *BaseAstTree) ParseAnnotation(doc *ast.CommentGroup) error
type BffAnnotationType ¶
type BffAnnotationType = string
type BffImpl ¶
type BffInterfaceAnnotation ¶
type BffInterfaceTree ¶
type BffInterfaceTree struct { FuncName string `json:"-" yaml:"-"` FileNode types.FileNode Annotation *BffInterfaceAnnotation `json:"-" yaml:"-"` }
func (*BffInterfaceTree) FillCrossStructs ¶
func (b *BffInterfaceTree) FillCrossStructs() error
func (*BffInterfaceTree) Parse ¶
func (b *BffInterfaceTree) Parse() error
func (*BffInterfaceTree) ParseAnnotation ¶
func (b *BffInterfaceTree) ParseAnnotation(docs *ast.CommentGroup) error
type BffItem ¶
type BffItem struct { DirNode types.DirNode `json:",omitempty" yaml:"-"` Impls []*BffImpl `json:",omitempty" yaml:"interfaces"` Sys *SystemDes `json:",omitempty" yaml:"-"` }
func (BffItem) MatchImplByName ¶
type BffRequestAnnotation ¶
type BffRequestTree ¶
type BffRequestTree struct { Name string FileNode types.FileNode Annotation *BffRequestAnnotation TopNode *xast.TopNode }
func (*BffRequestTree) FillCrossStructs ¶
func (b *BffRequestTree) FillCrossStructs() error
TODO Opz walk performance
func (*BffRequestTree) Parse ¶
func (b *BffRequestTree) Parse() error
func (*BffRequestTree) ParseAnnotation ¶
func (b *BffRequestTree) ParseAnnotation(docs *ast.CommentGroup) error
type BffResponseAnnotation ¶
type BffResponseTree ¶
type BffResponseTree struct { Name string FileNode types.FileNode Annotation *BffResponseAnnotation TopNode *xast.TopNode }
func (*BffResponseTree) FillCrossStructs ¶
func (b *BffResponseTree) FillCrossStructs() error
func (*BffResponseTree) Parse ¶
func (b *BffResponseTree) Parse() error
func (*BffResponseTree) ParseAnnotation ¶
func (b *BffResponseTree) ParseAnnotation(docs *ast.CommentGroup) error
type BffTree ¶
type Bffs ¶
type Bffs struct { DirNode types.DirNode `json:",omitempty" yaml:"-"` BffItems []*BffItem `json:",omitempty" yaml:"names"` Sys *SystemDes `json:",omitempty" yaml:"-"` }
func (Bffs) MatchBffByName ¶
func (Bffs) MatchBffImplByName ¶
type ExtendTree ¶
func NewExtendTree ¶
func NewExtendTree(tree *xast.TopNode) *ExtendTree
func (*ExtendTree) FlatNestedNodes ¶ added in v0.1.1
func (base *ExtendTree) FlatNestedNodes() *xast.TopNode
func (*ExtendTree) ReplaceExtraNode ¶
func (topNode *ExtendTree) ReplaceExtraNode(sourceTree *xast.TopNode, fullName ...string) (count int)
Note: topNode share memory with sourcetree
type MakeFileParam ¶
type ServiceAnnotationType ¶
type ServiceAnnotationType = string
type ServiceInterfaceTree ¶
type ServiceInterfaceTree struct { FuncName string `json:"-" yaml:"-"` *BaseAstTree }
func NewServiceInterfaceTree ¶
func NewServiceInterfaceTree(funcName string) *ServiceInterfaceTree
type ServiceRequestTree ¶
type ServiceRequestTree struct { VarName string *BaseAstTree }
func NewServiceRequestTree ¶
func NewServiceRequestTree(varName string) *ServiceRequestTree
type ServiceResponseTree ¶
type ServiceResponseTree struct { VarName string *BaseAstTree }
func NewServiceResponseTree ¶
func NewServiceResponseTree(varName string) *ServiceResponseTree
type ServiceTree ¶
type SystemDes ¶
type SystemDes struct { Name string `yaml:"name"` // "foo-system" ShortName string Author string `yaml:"author"` GoModel string `yaml:"gomod"` CreateTime string `yaml:"create_time"` UpdateTime string `yaml:"update_time"` Bffs *Bffs `yaml:"bff,omitempty"` // Services Services `yaml:"services,omitempty"` DirNode types.DirNode `json:",omitempty" yaml:"-"` }
func NewSystemDes ¶
Click to show internal directories.
Click to hide internal directories.