codegen

package
v2.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsOptional

func IsOptional(t string) bool

func Pattern2Method

func Pattern2Method(pattern string) string

/shelves/{shelf}/books/{book} [shelves,{shelf},books,{book}] shelves_{shelf}_books_{book} Shelves_ShelfBooks_Book

func RestyMethod

func RestyMethod(method string) string

Types

type ClientOperationConverter

type ClientOperationConverter struct {
	Generator *OpenAPICodeGenerator
	// contains filtered or unexported fields
}

func (*ClientOperationConverter) ConvertOperation

func (receiver *ClientOperationConverter) ConvertOperation(endpoint, httpMethod string, operation *v3.Operation, gparams []v3.Parameter) (astutils.MethodMeta, error)

type IOperationConverter

type IOperationConverter interface {
	ConvertOperation(endpoint, httpMethod string, operation *v3.Operation, gparams []v3.Parameter) (astutils.MethodMeta, error)
}

type OpenAPICodeGenerator

type OpenAPICodeGenerator struct {
	Schemas          map[string]v3.Schema
	RequestBodies    map[string]v3.RequestBody
	Responses        map[string]v3.Response
	Omitempty        bool
	SvcName, ModName string
	Comments         []string
	DtoPkg           string
	ApiInfo          *v3.Info
}

func (OpenAPICodeGenerator) APIComments

func (receiver OpenAPICodeGenerator) APIComments() []string

func (*OpenAPICodeGenerator) Api2Interface

func (receiver *OpenAPICodeGenerator) Api2Interface(paths map[string]v3.Path, svcName string, operationConverter IOperationConverter) astutils.InterfaceMeta

func (*OpenAPICodeGenerator) GenGoDto

func (receiver *OpenAPICodeGenerator) GenGoDto(schemas map[string]v3.Schema, output, pkg, tmpl string)

func (*OpenAPICodeGenerator) GenGoHTTP

func (receiver *OpenAPICodeGenerator) GenGoHTTP(paths map[string]v3.Path, svcName, dir, env, pkg string, operationConverter IOperationConverter)

func (*OpenAPICodeGenerator) GenGoInterface

func (receiver *OpenAPICodeGenerator) GenGoInterface(output string, paths map[string]v3.Path, operationConverter IOperationConverter)

type ServerOperationConverter

type ServerOperationConverter struct {
	Generator *OpenAPICodeGenerator
	// contains filtered or unexported fields
}

func (*ServerOperationConverter) ConvertOperation

func (receiver *ServerOperationConverter) ConvertOperation(endpoint, httpMethod string, operation *v3.Operation, gparams []v3.Parameter) (astutils.MethodMeta, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL