Documentation
¶
Index ¶
Constants ¶
View Source
const ( TagKey = "tag" NameKey = "name" OptionKey = "option" BodyTag = "json" )
Variables ¶
View Source
var ( TagRe = regexp.MustCompile(`(?P<tag>\w+):"(?P<name>[^,"]+)[,]?(?P<option>[^"]*)"`) TagSubNames = TagRe.SubexpNames() )
Functions ¶
This section is empty.
Types ¶
type ApiSpec ¶
func (*ApiSpec) ContainsTime ¶
type ArrayType ¶
type ArrayType struct {
StringExpr string
// it can be asserted as BasicType: int、bool、
// PointerType: *string、*User、
// MapType: map[${BasicType}]interface、
// ArrayType:[]int、[]User、[]*User
// InterfaceType: interface{}
// Type
ArrayType interface{}
}
type Group ¶
type Group struct {
Annotations []Annotation
Routes []Route
}
type InterfaceType ¶
type InterfaceType struct {
StringExpr string
}
type Member ¶
type Member struct {
Annotations []Annotation
Name string
// 数据类型字面值,如:string、map[int]string、[]int64、[]*User
Type string
// it can be asserted as BasicType: int、bool、
// PointerType: *string、*User、
// MapType: map[${BasicType}]interface、
// ArrayType:[]int、[]User、[]*User
// InterfaceType: interface{}
// Type
Expr interface{}
Tag string
// Deprecated
Comment string // 换成标准struct中将废弃
// 成员尾部注释说明
Comments []string
// 成员头顶注释说明
Docs []string
IsInline bool
}
func (Member) GetAttributes ¶
func (Member) GetComment ¶
func (Member) GetPropertyName ¶
func (Member) IsBodyMember ¶
func (Member) IsOmitempty ¶
func (Member) IsOptional ¶
type PointerType ¶
type PointerType struct {
StringExpr string
// it can be asserted as BasicType: int、bool、
// PointerType: *string、*User、
// MapType: map[${BasicType}]interface、
// ArrayType:[]int、[]User、[]*User
// InterfaceType: interface{}
// Type
Star interface{}
}
type Route ¶
type Route struct {
Annotations []Annotation
Method string
Path string
RequestType Type
ResponseType Type
}
type Service ¶
type Service struct {
Name string
Annotations []Annotation
Routes []Route
Groups []Group
}
type StructType ¶
type StructType struct {
StringExpr string
}
type Type ¶
type Type struct {
Name string
Annotations []Annotation
Members []Member
}
func (Type) GetBodyMembers ¶
func (Type) GetNonBodyMembers ¶
Click to show internal directories.
Click to hide internal directories.