gen

package
v0.0.0-...-9da822e Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Package string
	Imports Imports
	Funcs   Funcs
}

File represents a generated code file.

func NewFile

func NewFile(pkg string) *File

NewFile creates a new File with all fields initialized.

func (*File) String

func (f *File) String() string

String generates the file content.

type Func

type Func struct {
	RcvName, RcvType string
	Name             string
	RetVals          string
	Misc             map[string]interface{}
	Tmpl             string
}

Func represents a generated function.

func (Func) String

func (f Func) String() string

String generates the function code.

type Funcs

type Funcs []Func

Funcs represents a collection of generated functions.

func (Funcs) String

func (fs Funcs) String() string

String generates the code for all functions.

type Imports

type Imports map[string]struct{}

Imports represents a set of import paths.

func (Imports) String

func (is Imports) String() string

String generates the import statement.

Jump to

Keyboard shortcuts

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