Documentation ¶
Index ¶
- func HasAttribute(s *astp.Element, attrName string) bool
- func RegAttributeType(name string, value AttributeType)
- type Attribute
- func GetFieldAttributeAsParamType(f *astp.Element) []*Attribute
- func GetLastAttr(f *astp.Element) *Attribute
- func GetMethodAttributes(m *astp.Element) []*Attribute
- func GetMethodAttributesAsMiddleware(m *astp.Element) []*Attribute
- func GetStructAttrAsMiddleware(s *astp.Element) []*Attribute
- func GetStructAttrByName(s *astp.Element, attrName string) *Attribute
- func GetStructAttrs(s *astp.Element) []*Attribute
- func ParseDoc(doc []string, name string) []*Attribute
- type AttributeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegAttributeType ¶ added in v0.2.7
func RegAttributeType(name string, value AttributeType)
Types ¶
type Attribute ¶
type Attribute struct { Name string Value string Type AttributeType Index int }
Attribute 注解命令
func GetFieldAttributeAsParamType ¶
GetFieldAttributeAsParamType 返回参数对应类型上的注解
func GetMethodAttributes ¶
GetMethodAttributes 解析方法上的注释
func GetMethodAttributesAsMiddleware ¶
GetMethodAttributesAsMiddleware 提取方法上的中间件标记
func GetStructAttrAsMiddleware ¶
GetStructAttrAsMiddleware 返回结构体上的中间件类attr
func GetStructAttrByName ¶
GetStructAttrByName 按attr名称返回,不存在则返回nil
type AttributeType ¶
type AttributeType int
const ( TypeHttpMethod AttributeType = iota //http 请求方法 TypeOther //其他 TypeDoc //注释内容 TypeMiddleware //中间件类 TypeParam //方法的参数和返回值专用 TypeTagger //这种类型仅用于标记一些元素 TypeInner )
Click to show internal directories.
Click to hide internal directories.