generator

package
v0.0.0-...-fbb284c Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const UTIL_FILE = "primitive.go"

Variables

This section is empty.

Functions

func GenerateForSchema

func GenerateForSchema(packageName string, schemaJson []byte, pkg *Package) error

Add the structs and serializer/deserializer methods to the given Package

Types

type File

type File struct {
	// contains filtered or unexported fields
}

Represents a Go source file in the output package

func NewFile

func NewFile(name string) *File

func (*File) Functions

func (f *File) Functions() []FunctionName

func (*File) Imports

func (f *File) Imports() []string

func (*File) Structs

func (f *File) Structs() []string

type FunctionName

type FunctionName struct {
	// contains filtered or unexported fields
}

type FunctionNameList

type FunctionNameList []FunctionName

Implement the Sortable interface for FunctionNames

func (FunctionNameList) Len

func (f FunctionNameList) Len() int

func (FunctionNameList) Less

func (f FunctionNameList) Less(i, j int) bool

Sort functions by the struct to which they're attached first, then the name of the method itself. If the function isn't attached to a struct, put it at the bottom

func (FunctionNameList) Swap

func (f FunctionNameList) Swap(i, j int)

type Package

type Package struct {
	// contains filtered or unexported fields
}

Represents the output package

func NewPackage

func NewPackage(name string) *Package

func (*Package) File

func (p *Package) File(name string) (*File, bool)

func (*Package) Files

func (p *Package) Files() []string

func (*Package) WriteFiles

func (p *Package) WriteFiles(targetDir string) error

Jump to

Keyboard shortcuts

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