gogen

package
v0.0.0-...-21bd278 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidGoBasicTypes = []string{
	"bool",
	"int",
	"int32",
	"int64",
	"float32",
	"float64",
	"string",
}

Functions

func ParseSpec

func ParseSpec(spec *openapi3.T) error

func ParseYamlPath

func ParseYamlPath(path string) error

func WritePackage

func WritePackage(dir string, code string) error

Types

type SpecMeta

type SpecMeta struct {
	Spec            *openapi3.T
	Code            strings.Builder
	SchemaGenerated map[string]struct{}
}

func (*SpecMeta) GetCode

func (m *SpecMeta) GetCode() string

func (*SpecMeta) GetDefaultValue

func (m *SpecMeta) GetDefaultValue(val interface{}, typ string) string

func (*SpecMeta) GetDoc

func (m *SpecMeta) GetDoc(doc string) string

func (*SpecMeta) GetPrimitiveType

func (m *SpecMeta) GetPrimitiveType(typ string, format string) string

func (*SpecMeta) GetterName

func (m *SpecMeta) GetterName(propName string) string

func (*SpecMeta) IsValidGoBasicType

func (m *SpecMeta) IsValidGoBasicType(typ string) bool

func (*SpecMeta) LogVersions

func (m *SpecMeta) LogVersions()

func (*SpecMeta) NewMethod

func (m *SpecMeta) NewMethod(doc string, objName string, objType string, name string, inArgs []string, outTypes []string, body string) string

func (*SpecMeta) NewProperty

func (m *SpecMeta) NewProperty(doc string, name string, typ string) string

func (*SpecMeta) NewPropertyGetter

func (m *SpecMeta) NewPropertyGetter(objType string, propName string, propType string, defaultVal interface{}) string

func (*SpecMeta) NewPropertySetter

func (m *SpecMeta) NewPropertySetter(objType string, propName string, propType string) string

func (*SpecMeta) NewStruct

func (m *SpecMeta) NewStruct(doc string, name string, body string) string

func (*SpecMeta) ParseSchema

func (m *SpecMeta) ParseSchema(name string, schema *openapi3.SchemaRef) error

func (*SpecMeta) ParseSchemas

func (m *SpecMeta) ParseSchemas() error

func (*SpecMeta) SetterName

func (m *SpecMeta) SetterName(propName string) string

Jump to

Keyboard shortcuts

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