Versions in this module Expand all Collapse all v0 v0.1.0 Jun 2, 2023 Changes in this version + const TagRegular + var GraphTemplates = []GraphTemplate + var Templates = []NodeTemplate + func AddPattern(pattern string) (key string) + func GinReturnType(httpContent string) string + func HasTag(src []string, tag string) bool + func IsBytes(p code.Type) bool + func IsSupportNegotiate(ress []string) bool + func ModelMapToTypeInfo(model map[string]*ModelMap) (map[string]*code.TypeInfo, error) + func NewTemplate(name string) *helper.Template + func OasUriToGinUri(uri string) string + func PrepareEnv(c *Config) (undo func() error, err error) + type Config struct + Header string + Hooks []Hook + Models map[string]*ModelMap + OpenAPISchema string + Package string + Schemas []*Schema + Target string + Templates []*helper.Template + TypeMap map[string]*code.TypeInfo + func (c *Config) AddSchema(ref string, schema *Schema) + func (c *Config) AddTypeMap(key string, t *code.TypeInfo) + func (c Config) Imports() []string + type GenerateFunc func(*Graph) error + func (f GenerateFunc) Generate(g *Graph) error + type Generator interface + Generate func(*Graph) error + type Graph struct + Nodes []*Tag + Spec *openapi3.T + func NewGraph(c *Config, schema *openapi3.T) (g *Graph, err error) + func (g *Graph) Gen() error + type GraphTemplate struct + ExtendPatterns []string + Format string + Name string + Skip func(*Graph) bool + type Hook func(Generator) Generator + type ModelMap struct + Model string + type NodeTemplate struct + ExtendPatterns []string + Format func(*Tag) string + Name string + type Operation struct + Group string + IgnoreInterface bool + Method string + Name string + Path string + Request *Request + ResponseNotFound *Response + ResponseOK *Response + Responses []*Response + Spec *openapi3.Operation + SpecPathItem *openapi3.PathItem + func (op *Operation) AddParameter(params ...*Parameter) + func (op *Operation) GenRequest() + func (op *Operation) GenResponse(codeStr string, spec *openapi3.ResponseRef) *Response + func (op *Operation) GenResponses() + func (op *Operation) GenSecurity(ssSpec openapi3.SecuritySchemes) + func (op *Operation) HasRequest() bool + func (op *Operation) HasResponse() bool + func (op *Operation) RequestName() string + func (op *Operation) SimpleBody() *Parameter + type Parameter struct + Name string + Schema *Schema + Spec *openapi3.Parameter + type Request struct + BindBody bool + BindCookie bool + BindHeader bool + BindUri bool + Body []*Parameter + BodyContentTypes []string + CookieParameters []*Parameter + HeaderParameters []*Parameter + Parameters []*Parameter + UriParameters []*Parameter + type Response struct + ContentTypes []string + Description *string + Name string + Schema *Schema + Spec *openapi3.Response + Status int + type Schema struct + HasRegular bool + IsAlias bool + IsArray bool + IsInline bool + IsRef bool + IsReplace bool + Name string + Properties map[string]*Schema + Required bool + Spec *openapi3.SchemaRef + StructTags []string + Type *code.TypeInfo + func (sch *Schema) AppendContentTypeStructTag(c *Config, tagName string, contentTypes []string) + func (sch *Schema) CheckRequired() + func (sch *Schema) CollectTags() + func (sch *Schema) CopyTo(tg *Schema) + func (sch *Schema) GenSchemaType(c *Config, name string, spec *openapi3.SchemaRef) + func (sch *Schema) IsObjectArray() bool + func (sch Schema) StructTagsString() string + type Tag struct + Name string + Operations []*Operation + Spec *openapi3.Tag + func (t *Tag) AddOperation(ops ...*Operation) + func (t *Tag) InterfaceName() string + func (t *Tag) PackageDir() string