goserver

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// DefaultPackage name for go
	DefaultPackage = "oa3gen"
	// Disclaimer printed to the top of Go files
	Disclaimer = `` /* 149-byte string literal not displayed */

)
View Source
const (
	ParamKeyPackage  = "package"
	ParamKeyTimeType = "timetype"
)

Constants for keys recognized in the parameters for the Go server

Variables

View Source
var TemplateFunctions = map[string]interface{}{
	"camelSnake":        CamelSnake,
	"primitive":         primitive,
	"primitiveRaw":      primitiveRaw,
	"primitiveBits":     primitiveBits,
	"isInlinePrimitive": isInlinePrimitive,
	"taggedPaths":       tagPaths,
	"responseKind":      responseKind,

	"mustValidate": mustValidate,
}

TemplateFunctions to use for generation

View Source
var TemplateList = []string{
	"api_interface.tpl",
	"api_methods.tpl",
	"responses.tpl",
	"schema.tpl",
	"schema_top.tpl",

	"validate_schema.tpl",
	"validate_field.tpl",
}

templates for generation

Functions

func CamelSnake added in v0.0.24

func CamelSnake(filename string) string

schema_UserIDProfile -> schema_user_id_profile ID -> id

func GenerateTopLevelSchemas added in v0.0.24

func GenerateTopLevelSchemas(spec *openapi3spec.OpenAPI3, params map[string]string, tpl *template.Template) ([]generator.File, error)

GenerateSchemas creates files for the topLevel-level referenceable types

Some supported Inline are also generated. Prefixed with their recursive names and Inline. components.responses[name].headers[headername].schema components.responses[name].content[mime-type].schema components.responses[name].content[mime-type].encoding[propname].headers[headername].schema components.parameters[name].schema components.requestBodies[name].content[mime-type].schema components.requestBodies[name].content[mime-type].encoding[propname].headers[headername].schema components.headers[name].schema paths.parameters[0].schema paths.(get|put...).parameters[0].schema paths.(get|put...).requestBody.content[mime-type].schema paths.(get|put...).responses[name].headers[headername].schema paths.(get|put...).responses[name].content[mime-type].schema paths.(get|put...).responses[name].content[mime-type].encoding[propname].headers[headername].schema

func Imports added in v0.0.24

func Imports(imps map[string]struct{}) string

func New

func New() generator.Interface

New go generator

Types

This section is empty.

Jump to

Keyboard shortcuts

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