Documentation
¶
Index ¶
- Variables
- func NewPathParamsParsers(path string, params []PathParameter) ([]generator.Templater, error)
- func PathName(s string) string
- type ConvertStrings
- type CustomType
- type CustomTypeParser
- type ErrorBuilder
- type ErrorWrapper
- type GoConstDef
- type GoFieldTag
- type GoFile
- type GoFileImport
- type GoFunction
- type GoFunctionArg
- type GoMap
- type GoSlice
- type GoStruct
- type GoStructField
- type GoType
- type GoTypeDef
- type GoValue
- type GoVarDef
- type Handler
- type Handlers
- type HeaderItem
- type HeaderParser
- type OptionalParam
- type Param
- type PathConstantParser
- type PathItem
- type PathOperationItem
- type PathParameter
- type PathParameterParser
- type QueryParser
- type ReRoute
- type Ref
- type Render
- func NewBodyRef(spec *openapi3.RequestBodyRef) (_ Render, ok bool)
- func NewHeaderParser(p *openapi3.Parameter, field GoStructField) Render
- func NewQueryParser(p *openapi3.Parameter, field GoStructField) Render
- func NewStringsParser(s SchemaRender, from, toOrig string, isPointer bool, mkErr ErrorWrapper) Render
- type RenderFunc
- type Response
- type ResponseArg
- type ResponseHeader
- type ResponseItem
- type Route
- type RouteHandler
- type RouteMethod
- type Router
- type SchemaRender
- type SchemasItem
- type SchemasItems
- type StringValue
- type StringsParser
- type StructParser
Constants ¶
This section is empty.
Variables ¶
View Source
var HandlerName = generator.OperationNameOld
View Source
var PrivateFieldName = generator.PrivateFieldName
View Source
var PublicFieldName = generator.PublicFieldName
View Source
var String = source.String
Functions ¶
func NewPathParamsParsers ¶
func NewPathParamsParsers(path string, params []PathParameter) ([]generator.Templater, error)
Types ¶
type ConvertStrings ¶
type ConvertStrings struct {
ItemType SchemaRender
From, To string
MkErr ErrorWrapper
}
func (ConvertStrings) ItemRender ¶
func (c ConvertStrings) ItemRender(from, toOrig string) (string, error)
func (ConvertStrings) String ¶
func (c ConvertStrings) String() (string, error)
type CustomType ¶ added in v0.0.11
type CustomType string
func NewCustomType ¶ added in v0.0.11
func NewCustomType(s string) CustomType
func (CustomType) Parser ¶ added in v0.0.11
func (c CustomType) Parser(from, to string, mkErr source.ErrorWrapper) source.Render
func (CustomType) String ¶ added in v0.0.11
func (c CustomType) String() (string, error)
type CustomTypeParser ¶ added in v0.0.11
type CustomTypeParser struct {
Type string
From string
To string
Error source.ErrorWrapper
}
func (CustomTypeParser) String ¶ added in v0.0.11
func (c CustomTypeParser) String() (string, error)
type ErrorBuilder ¶
type ErrorBuilder = source.ErrorBuilder
type ErrorWrapper ¶
type ErrorWrapper = source.ErrorWrapper
type GoConstDef ¶
func (GoConstDef) String ¶
func (g GoConstDef) String() (string, error)
type GoFieldTag ¶
func (GoFieldTag) String ¶
func (g GoFieldTag) String() (string, error)
type GoFile ¶
type GoFile struct {
DoNotEdit bool
PackageName string
Imports []GoFileImport
Renders []Render
}
type GoFileImport ¶
type GoFunction ¶
type GoFunction struct {
Receiver GoFunctionArg
Name string
Args []GoFunctionArg
Returns []GoFunctionArg
Body Render
}
func MarshalJSONFunc ¶
func MarshalJSONFunc(orig GoType, body GoStruct) GoFunction
func (GoFunction) String ¶
func (g GoFunction) String() (string, error)
type GoFunctionArg ¶
func (GoFunctionArg) String ¶
func (g GoFunctionArg) String() (string, error)
type GoMap ¶
type GoMap struct {
Key, Value SchemaRender
}
func (GoMap) Optionable ¶
func (GoMap) Optionable()
type GoSlice ¶
type GoSlice struct {
Items SchemaRender
}
func (GoSlice) Optionable ¶
func (GoSlice) Optionable()
func (GoSlice) StringsParser ¶
func (s GoSlice) StringsParser(from, to string, mkErr ErrorWrapper) Render
type GoStruct ¶
type GoStruct struct {
Fields []GoStructField
}
type GoStructField ¶
type GoStructField struct {
Name string
Comment string
Type SchemaRender
Tags []GoFieldTag
}
func NewGoStructField ¶
func NewGoStructField(name string, schema *openapi3.SchemaRef, description string) (zero GoStructField)
func NewGoStructFieldTags ¶
func NewGoStructFieldTags(name string, schema *openapi3.SchemaRef, tags ...GoFieldTag) (zero GoStructField)
func NewGoStructFields ¶
func NewGoStructFields(si SchemasItems) []GoStructField
func (GoStructField) GetTag ¶
func (g GoStructField) GetTag(key string) (GoFieldTag, bool)
func (GoStructField) String ¶
func (g GoStructField) String() (string, error)
type Handler ¶
type Handler struct {
generator.HandlerOld
Path string
Method specification.HTTPMethodTitle
Responses []Response
Params struct {
Query []Param
}
}
func NewHandler ¶
func NewHandler(p *openapi3.Operation, path specification.PathOld2, method specification.HTTPMethodTitle, params openapi3.Parameters, o *specification.Operation) (zero Handler, _ error)
type Handlers ¶
func NewHandlers ¶
func NewHandlers(s *specification.Spec, basePath string) (zero Handlers, _ error)
type HeaderItem ¶
func PathHeaders ¶
func PathHeaders(spec openapi3.Headers) []HeaderItem
type HeaderParser ¶
func (HeaderParser) String ¶
func (i HeaderParser) String() (string, error)
type OptionalParam ¶
type OptionalParam struct {
SchemaRender
}
func (OptionalParam) String ¶
func (r OptionalParam) String() (string, error)
type Param ¶
type Param struct {
Field GoStructField
Parser Render
Parameter *openapi3.Parameter
}
func NewHeaderParam ¶
func NewQueryParam ¶
type PathConstantParser ¶
func (PathConstantParser) String ¶
func (p PathConstantParser) String() (string, error)
type PathOperationItem ¶
func PathOperations ¶
func PathOperations(spec *openapi3.PathItem) []PathOperationItem
type PathParameter ¶
type PathParameter struct {
Name string
FieldName string
// GoType GoType
Type SchemaRender
Field GoStructField
}
func NewPathParameter ¶
func NewPathParameter(p *openapi3.Parameter) PathParameter
type PathParameterParser ¶
type PathParameterParser struct {
Variable string
Convert Render
Error ErrorBuilder
}
func (PathParameterParser) String ¶
func (p PathParameterParser) String() (string, error)
type QueryParser ¶
func (QueryParser) String ¶
func (i QueryParser) String() (string, error)
type Render ¶
func NewBodyRef ¶
func NewBodyRef(spec *openapi3.RequestBodyRef) (_ Render, ok bool)
func NewHeaderParser ¶
func NewHeaderParser(p *openapi3.Parameter, field GoStructField) Render
func NewQueryParser ¶
func NewQueryParser(p *openapi3.Parameter, field GoStructField) Render
func NewStringsParser ¶
func NewStringsParser(s SchemaRender, from, toOrig string, isPointer bool, mkErr ErrorWrapper) Render
type RenderFunc ¶ added in v0.0.10
type RenderFunc = source.RenderFunc
type Response ¶
type Response struct {
Name string
PrivateName string
HandlerName string
Description string
Status int
IsDefault bool
ResponserInterfaceName string
IsBody bool
Body Render
Headers []ResponseHeader
Struct GoTypeDef
Args []ResponseArg
}
func NewResponse ¶
type ResponseArg ¶
type ResponseHeader ¶
type ResponseHeader struct {
Name string
FieldName string
Type SchemaRender
}
type ResponseItem ¶
type ResponseItem struct {
Code string
Response *openapi3.ResponseRef
}
func PathResponses ¶
func PathResponses(spec openapi3.Responses) []ResponseItem
type Route ¶
type Route struct {
Name string
Handlers []RouteHandler
WildcardHandler *RouteHandler
Routes []ReRoute
WildcardRouteName string
}
type RouteHandler ¶
type RouteHandler struct {
Prefix string
Methods []RouteMethod
}
type RouteMethod ¶
type RouteMethod struct {
Method specification.HTTPMethodTitle
HandlerName string
Path string
}
type Router ¶
type SchemaRender ¶
type SchemaRender interface {
Render
Parser(from, to string, _ ErrorWrapper) Render
Format(s string) source.Templater
}
func NewOptionalParam ¶
func NewOptionalParam(sr SchemaRender) SchemaRender
func NewSchema ¶
func NewSchema(spec *openapi3.Schema) SchemaRender
func NewSchemaRef ¶
func NewSchemaRef(spec *openapi3.SchemaRef) SchemaRender
type SchemasItem ¶
type SchemasItems ¶
type SchemasItems []SchemasItem
func NewSchemas ¶
func NewSchemas(ss openapi3.Schemas) SchemasItems
type StringValue ¶
type StringValue GoValue
func (StringValue) String ¶
func (s StringValue) String() (string, error)
type StringsParser ¶
type StringsParser interface {
StringsParser(from, to string, _ ErrorWrapper) Render
}
type StructParser ¶
type StructParser struct {
From, To string
Error ErrorWrapper
}
func (StructParser) String ¶
func (s StructParser) String() (string, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.