_go

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FuncMap = template.FuncMap{
		"registerStruct": RegisterStruct,
		"structLocation": StructLocation,
		"structRegistry": StructRegistry,
		"NewStruct":      NewStruct,
		"NewMyProperty":  NewProperty,
		"NewImports":     NewImports,
	}
)

Functions

func Load

func Load()

func RegisterStruct

func RegisterStruct(schemaName string, packageName string) string

func StructLocation

func StructLocation(schemaName string) string

func StructRegistry

func StructRegistry() map[string]string

Types

type Import

type Import struct {
	Path  string
	Alias string
}

type Imports

type Imports []Import

func NewImports

func NewImports() *Imports

func (*Imports) Add

func (i *Imports) Add(path string, args ...string) *Imports

Add only first element in args is used as alias if not empty

func (*Imports) AddWithAlias

func (i *Imports) AddWithAlias(path, alias string) *Imports

type Property

type Property struct {
	Name     string
	Type     string
	Bindings string
}

Property represents strictly what is needed to represent a struct property in Golang

func NewProperty

func NewProperty(name string, typeOfProperty string) *Property

func (*Property) AddBinding

func (m *Property) AddBinding(binding string) *Property

func (*Property) AddType

func (m *Property) AddType(typeOfProperty string) *Property

type Struct

type Struct struct {
	Properties      []Property
	EmbeddedStructs []Struct
	Package         string
	Name            string
}

func NewStruct

func NewStruct(name string, pkg string) *Struct

func (*Struct) AddEmbeddedStruct

func (m *Struct) AddEmbeddedStruct(ref string) *Struct

func (*Struct) AddProperties

func (m *Struct) AddProperties(property Property) *Struct

Jump to

Keyboard shortcuts

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