Documentation
¶
Index ¶
- func AddMethodAttributeType(name string, typ AttributeType)
- func AddStructAttributeType(name string, t AttributeType)
- func HasAttribute(s *astp.Struct, name string) bool
- type Attribute
- func GetFieldAttributeAsParamType(f *astp.ParamField) []*Attribute
- func GetLastAttr(f *astp.ParamField) *Attribute
- func GetMethodAttributes(m *astp.Method) []*Attribute
- func GetMethodAttributesAsMiddleware(m *astp.Method) []*Attribute
- func GetStructAttrAsMiddleware(s *astp.Struct) []*Attribute
- func GetStructAttrByName(s *astp.Struct, name string) *Attribute
- func GetStructAttrs(s *astp.Struct) []*Attribute
- func ParseDoc(doc []string, name string, i map[string]AttributeType) []*Attribute
- type AttributeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMethodAttributeType ¶
func AddMethodAttributeType(name string, typ AttributeType)
func AddStructAttributeType ¶
func AddStructAttributeType(name string, t AttributeType)
Types ¶
type Attribute ¶
type Attribute struct {
Name string
Value string
Type AttributeType
Index int
}
Attribute 注解命令
func GetFieldAttributeAsParamType ¶
func GetFieldAttributeAsParamType(f *astp.ParamField) []*Attribute
func GetLastAttr ¶
func GetLastAttr(f *astp.ParamField) *Attribute
func GetMethodAttributes ¶
func GetStructAttrs ¶
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.