Documentation ¶
Index ¶
- Constants
- Variables
- func BindValidateFromValidateTagString(schema *oas.Schema, validate string)
- func CommentValuesSplit(s string) (values []string)
- func ConcatToOperation(method string, operators ...Operator) *oas.Operation
- func FullNameOfType(tpe reflect.Type) string
- func IdentOfCallExprSelectExpr(selectExpr *ast.SelectorExpr) *ast.Ident
- func ParseEnum(doc string) (string, bool)
- func ParseStrfmt(doc string) (string, string)
- func ParseSuccessMetadata(doc string) courier.Metadata
- type DefinitionScanner
- type Enum
- type EnumScanner
- type Operator
- func (operator *Operator) AddNonBodyParameter(parameter *oas.Parameter)
- func (operator *Operator) AddWebSocketMessage(schema *oas.Schema, returns ...*oas.Schema)
- func (operator *Operator) BindOperation(method string, operation *oas.Operation, last bool)
- func (operator *Operator) SetRequestBody(requestBody *oas.RequestBody)
- type OperatorScanner
- type OperatorTypeNames
- type Route
- type Router
- type RouterScanner
- type StatusErrorScanner
- type StructFieldUniqueChecker
- type SwaggerGenerator
- type VendorExtensible
Constants ¶
View Source
const ( XNamed = `x-go-named` XField = `x-go-name` XTagJSON = `x-go-json` XTagName = `x-tag-name` XTagXML = `x-tag-xml` XTagStyle = `x-tag-style` XTagFmt = `x-tag-fmt` XTagValidate = `x-go-validate` XPointer = "x-pointer" XEnumValues = `x-enum-values` XEnumLabels = `x-enum-labels` XEnumVals = `x-enum-vals` )
Variables ¶
View Source
var RxHttpRouterPath = regexp.MustCompile("/:([^/]+)")
View Source
var TypeWebSocketClient = FullNameOfType(reflect.TypeOf(transport_http.WSClient{}))
View Source
var TypeWebSocketListeners = FullNameOfType(reflect.TypeOf(transport_http.Listeners{}))
Functions ¶
func CommentValuesSplit ¶
func ConcatToOperation ¶
func FullNameOfType ¶
func IdentOfCallExprSelectExpr ¶
func IdentOfCallExprSelectExpr(selectExpr *ast.SelectorExpr) *ast.Ident
func ParseStrfmt ¶
func ParseSuccessMetadata ¶
Types ¶
type DefinitionScanner ¶
type DefinitionScanner struct { EnumScanner *EnumScanner // contains filtered or unexported fields }
func NewDefinitionScanner ¶
func NewDefinitionScanner(program *loader.Program) *DefinitionScanner
func (*DefinitionScanner) BindSchemas ¶
func (scanner *DefinitionScanner) BindSchemas(openapi *oas.OpenAPI)
type Enum ¶
type Enum enumeration.Enum
type EnumScanner ¶
type EnumScanner struct { Enums map[*types.TypeName]Enum // contains filtered or unexported fields }
func NewEnumScanner ¶
func NewEnumScanner(program *loader.Program) *EnumScanner
type Operator ¶
type Operator struct { ID string NonBodyParameters map[string]*oas.Parameter RequestBody *oas.RequestBody StatusErrors status_error.StatusErrorCodeMap StatusErrorSchema *oas.Schema Tag string Summary string SuccessType types.Type SuccessStatus int SuccessResponse *oas.Response WebSocketMessages map[*oas.Schema][]*oas.Schema }
func (*Operator) AddNonBodyParameter ¶
func (*Operator) AddWebSocketMessage ¶
func (*Operator) BindOperation ¶
func (*Operator) SetRequestBody ¶
func (operator *Operator) SetRequestBody(requestBody *oas.RequestBody)
type OperatorScanner ¶
type OperatorScanner struct { *DefinitionScanner *StatusErrorScanner // contains filtered or unexported fields }
func NewOperatorScanner ¶
func NewOperatorScanner(program *loader.Program) *OperatorScanner
type OperatorTypeNames ¶
func FromArgs ¶
func FromArgs(pkgInfo *loader.PackageInfo, args ...ast.Expr) OperatorTypeNames
func (OperatorTypeNames) Append ¶
func (ops OperatorTypeNames) Append(tpe types.Type) OperatorTypeNames
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) AppendOperators ¶
type RouterScanner ¶
type RouterScanner struct {
// contains filtered or unexported fields
}
func NewRouterScanner ¶
func NewRouterScanner(program *loader.Program) *RouterScanner
type StatusErrorScanner ¶
type StatusErrorScanner struct {
// contains filtered or unexported fields
}
func NewStatusErrorScanner ¶
func NewStatusErrorScanner(program *loader.Program) *StatusErrorScanner
func (*StatusErrorScanner) StatusErrorsInFunc ¶
func (scanner *StatusErrorScanner) StatusErrorsInFunc(typeFunc *types.Func) status_error.StatusErrorCodeMap
type SwaggerGenerator ¶
type SwaggerGenerator struct { RootRouterName string Next bool // contains filtered or unexported fields }
func (*SwaggerGenerator) Load ¶
func (g *SwaggerGenerator) Load(cwd string)
func (*SwaggerGenerator) Pick ¶
func (g *SwaggerGenerator) Pick()
type VendorExtensible ¶
type VendorExtensible interface {
AddExtension(key string, value interface{})
}
Click to show internal directories.
Click to hide internal directories.