Documentation ¶
Index ¶
- func This() string
- type Function
- type FunctionSignature
- type Interface
- type Method
- func NewCommentedPointerMethod(pkg, name, structName string, params, ret, block []jen.Code, comment jen.Code) *Method
- func NewCommentedValueMethod(pkg, name, structName string, params, ret, block []jen.Code, comment jen.Code) *Method
- func NewPointerMethod(pkg, name, structName string, params, ret, block []jen.Code) *Method
- func NewValueMethod(pkg, name, structName string, params, ret, block []jen.Code) *Method
- type Struct
- type Typedef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Function ¶
type Function struct {
// contains filtered or unexported fields
}
Function represents a free function, not a method, for Go code to be generated.
func NewCommentedFunction ¶
func NewCommentedFunction(pkg, name string, params, ret, block []jen.Code, comment jen.Code) *Function
NewCommentedFunction creates a new function with a comment.
func NewFunction ¶
NewFunction creates a new function without any comments.
func (Function) Call ¶
Call generates the Go code required to call this function, with qualifier if required.
func (Function) Definition ¶
Definition generates the Go code required to define and implement this function.
type FunctionSignature ¶
type Interface ¶
type Interface struct {
// contains filtered or unexported fields
}
func NewInterface ¶
func NewInterface(pkg, name string, funcs []FunctionSignature, comment string) *Interface
func (Interface) Definition ¶
type Method ¶
type Method struct {
// contains filtered or unexported fields
}
Method represents a method on a type, not a free function, for Go code to be generated.
func NewCommentedPointerMethod ¶
func NewCommentedPointerMethod(pkg, name, structName string, params, ret, block []jen.Code, comment jen.Code) *Method
NewCommentedPointerMethod defines a commented method for the pointer to a type.
func NewCommentedValueMethod ¶
func NewCommentedValueMethod(pkg, name, structName string, params, ret, block []jen.Code, comment jen.Code) *Method
NewCommentedValueMethod defines a commented method for the value of a type.
func NewPointerMethod ¶
NewPointerMethod defines a method for the pointer to a type. It is not commented.
func NewValueMethod ¶
NewValueMethod defines a method for the value of a type. It is not commented.
func (Method) Call ¶
Call generates the Go code required to call this method, with qualifier if required.
func (Method) Definition ¶
Definition generates the Go code required to define and implement this method.
type Struct ¶
type Struct struct {
// contains filtered or unexported fields
}
Struct defines a struct-based type, its functions, and its methods for Go code generation.
func NewStruct ¶
func NewStruct(comment jen.Code, name string, methods []*Method, constructors []*Function, members []jen.Code) *Struct
NewStruct creates a new commented Struct type.
func (*Struct) Constructors ¶
Constructors obtains the Go code to be generated for the function with a specific name. Panics if no such function exists.
func (*Struct) Definition ¶
Definition generates the Go code required to define and implement this struct, its methods, and its functions.
type Typedef ¶
type Typedef struct {
// contains filtered or unexported fields
}
Typedef defines a non-struct-based type, its functions, and its methods for Go code generation.
func NewTypedef ¶
func NewTypedef(comment jen.Code, name string, concreteType jen.Code, methods []*Method, constructors []*Function) *Typedef
NewTypedef creates a new commented Typedef.
func (*Typedef) Constructors ¶
Constructors obtains the Go code to be generated for the function with a specific name. Panics if no such function exists.
func (*Typedef) Definition ¶
Definition generates the Go code required to define and implement this type, its methods, and its functions.