def

package
v0.0.0-...-3f0b436 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyQual = Q{}
View Source
var EmptyVar = Var{}

Functions

func JenEach

func JenEach(jenArr interface{}, sep ...jen.Code) *jen.Statement

TODO: remove?

Types

type Jen

type Jen interface {
	Jen() *jen.Statement
}

type Method

type Method struct {
	Name     string
	Receiver Var
	In       Vars
	Out      Types
	Body     *jen.Statement
}

func (Method) Copy

func (r Method) Copy() Method

func (Method) Jen

func (r Method) Jen() *jen.Statement

Generate method

type Q

type Q struct {
	PkgPath string
	Name    string
}

func (Q) Local

func (q Q) Local() Q

func (Q) Qual

func (q Q) Qual() *jen.Statement

func (Q) T

func (q Q) T() Types

returns T of Q

type Types

type Types []Var

func (Types) Append

func (r Types) Append(v Types) Types

func (Types) Copy

func (r Types) Copy(v Types) Types

func (Types) FilterByName

func (r Types) FilterByName(name string) Types

TODO: Seems dumb. This is probably broken or hack

func (Types) FilterByPkg

func (r Types) FilterByPkg(pkg string) Types

func (Types) FilterByQ

func (r Types) FilterByQ(q Q) Types

func (Types) First

func (r Types) First() Var

func (Types) Jen

func (r Types) Jen() *jen.Statement

func (Types) Last

func (r Types) Last() Var

type Var

type Var struct {
	Name string
	//Pass prototype
	Datatype  reflect.Type
	Qualifier Q
	Pointer   string
}

func (Var) Jen

func (r Var) Jen() *jen.Statement

func (Var) Local

func (r Var) Local() Var

func (Var) Ptr

func (r Var) Ptr() Var

func (Var) Q

func (r Var) Q() Q

func (Var) Qual

func (r Var) Qual() *jen.Statement

func (Var) String

func (r Var) String() string

type Vars

type Vars []Var

func (Vars) Append

func (r Vars) Append(v ...Var) Vars

func (Vars) Copy

func (r Vars) Copy() Vars

func (Vars) Empty

func (r Vars) Empty() bool

func (Vars) FilterByName

func (r Vars) FilterByName(name string) Vars

func (Vars) First

func (r Vars) First() Var

func (Vars) Jen

func (r Vars) Jen() *jen.Statement

func (Vars) SortByName

func (r Vars) SortByName() Vars

func (Vars) String

func (r Vars) String() string

Jump to

Keyboard shortcuts

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