translator

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNameFromRef

func GetNameFromRef(s string) string

func MakeIdentifier

func MakeIdentifier(s string) string

func MakeTitledIdentifier

func MakeTitledIdentifier(s string) string

Types

type Field

type Field struct {
	Name      string    // UserID
	GoType    string    // int64
	Parameter string    // user_id
	Type      FieldType // IntegerField
	Schema    openapi3.SchemaType
}

Field represents struct field

func (Field) CheckDefault added in v0.0.11

func (f Field) CheckDefault() bool

func (Field) IsArray added in v0.0.10

func (f Field) IsArray() bool

func (Field) IsBoolean added in v0.0.12

func (f Field) IsBoolean() bool

func (Field) IsComponent added in v0.0.6

func (f Field) IsComponent() bool

func (Field) IsCustom

func (f Field) IsCustom() bool

func (Field) IsDate

func (f Field) IsDate() bool

func (Field) IsDateTime

func (f Field) IsDateTime() bool

func (Field) IsFile added in v0.0.10

func (f Field) IsFile() bool

func (Field) IsFloat

func (f Field) IsFloat() bool

func (Field) IsInteger

func (f Field) IsInteger() bool

func (Field) IsString

func (f Field) IsString() bool

func (Field) IsStruct added in v0.0.6

func (f Field) IsStruct() bool

func (Field) IsUnixTime

func (f Field) IsUnixTime() bool

func (Field) SecondsVarName

func (f Field) SecondsVarName() string

func (Field) StrVarName

func (f Field) StrVarName() string

type FieldType

type FieldType int
const (
	UnknownField FieldType = iota
	ArrayField
	BooleanField
	ComponentField
	CustomField
	DateField
	DateTimeField
	FileField
	FloatField
	FreeFormObject
	IntegerField
	StringField
	StructField
	UnixTimeField
)

type TypeDef

type TypeDef struct {
	Name   string
	GoType string
	Fields []Field

	Level int
	Place string
}

func ProcessObjSchema

func ProcessObjSchema(schema openapi3.SchemaType, queue *list.List) (def TypeDef, err error)

func ProcessRootSchema

func ProcessRootSchema(schema openapi3.SchemaType) ([]TypeDef, error)

func (TypeDef) HasNoFileFields added in v0.0.10

func (d TypeDef) HasNoFileFields() bool

func (TypeDef) HasNoStringFields

func (d TypeDef) HasNoStringFields() bool

Jump to

Keyboard shortcuts

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