Documentation ¶
Index ¶
- func AddDefinition(defs map[string]Definition, name string, value reflect.Value)
- func AddResponseDefinitions(defs map[string]Definition, schema Schema, name string, statusCode int, ...)
- func Errors(errs ...error) map[error]interface{}
- func GenDefinitions(defs map[string]Definition) string
- func GenPaths(resps []OASResponses, paths string) string
- func Handler(apiDocFn APIDocFunc, schema Schema) http.HandlerFunc
- type APIDocFunc
- type Definition
- type GetFailuresFunc
- type GetSuccessFunc
- type GoStruct
- type GoTypeRegistry
- func (r *GoTypeRegistry) FullName(typ reflect.Type) string
- func (r *GoTypeRegistry) Name(typ reflect.Type) string
- func (r *GoTypeRegistry) Properties(typ reflect.Type) []Property
- func (r *GoTypeRegistry) Register(typ reflect.Type, name string) bool
- func (r *GoTypeRegistry) SetProperties(typ reflect.Type, properties []Property)
- type ItemType
- type JSONType
- type OASResponse
- type OASResponses
- type Parser
- type Property
- type Response
- type ResponseSchema
- type Schema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDefinition ¶
func AddDefinition(defs map[string]Definition, name string, value reflect.Value)
func AddResponseDefinitions ¶
func AddResponseDefinitions(defs map[string]Definition, schema Schema, name string, statusCode int, body interface{})
func GenDefinitions ¶
func GenDefinitions(defs map[string]Definition) string
func GenPaths ¶
func GenPaths(resps []OASResponses, paths string) string
func Handler ¶
func Handler(apiDocFn APIDocFunc, schema Schema) http.HandlerFunc
Types ¶
type APIDocFunc ¶
type Definition ¶
type Definition struct { Type string ItemTypeOrProperties interface{} }
type GetFailuresFunc ¶
type GetSuccessFunc ¶
type GetSuccessFunc func(body interface{}) interface{}
type GoTypeRegistry ¶
type GoTypeRegistry struct {
// contains filtered or unexported fields
}
GoTypeRegistry is a mapping from "fully qualified type name" to "local type name".
func NewGoTypeRegistry ¶
func NewGoTypeRegistry() *GoTypeRegistry
func (*GoTypeRegistry) Properties ¶
func (r *GoTypeRegistry) Properties(typ reflect.Type) []Property
func (*GoTypeRegistry) Register ¶
func (r *GoTypeRegistry) Register(typ reflect.Type, name string) bool
Register tries to register the given typ and returns whether typ is successfully registered.
func (*GoTypeRegistry) SetProperties ¶
func (r *GoTypeRegistry) SetProperties(typ reflect.Type, properties []Property)
type OASResponse ¶
type OASResponses ¶
type OASResponses struct { ContentTypes map[string]bool Success OASResponse Failures map[int]OASResponse }
func GetOASResponses ¶
func GetOASResponses(schema Schema, name string, statusCode int, body interface{}) OASResponses
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) AddDefinition ¶
func (*Parser) Definitions ¶
func (p *Parser) Definitions() map[string]Definition
type ResponseSchema ¶
type ResponseSchema struct { Codecs httpcodec.Codecs GetSuccessFunc GetSuccessFunc GetFailuresFunc GetFailuresFunc }
func (*ResponseSchema) FailureResponses ¶
func (rs *ResponseSchema) FailureResponses(name string) (resps []Response)
func (*ResponseSchema) SuccessResponse ¶
func (rs *ResponseSchema) SuccessResponse(name string, statusCode int, body interface{}) Response
Click to show internal directories.
Click to hide internal directories.