Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFunctionReturnArgument is returned when the Substate interface // contains a method which returns a function. ErrFunctionReturnArgument = errors.New("function return args are not supported") // ErrMultipleReturnArguments is returned when the Substate interface // contains a method with multiple return arguments. ErrMultipleReturnArguments = errors.New("multiple return args are not supported") // ErrSubstateNotFound is returned when gensubstate is run in a file which // doesn't contain a Substate interface. ErrSubstateNotFound = errors.New("no substate interface found") )
Functions ¶
Types ¶
type Field ¶
type Field struct {
// The name of the attribute within the generated struct.
Name string
// The name of the method in the Substate interface which should be
// implemented on the generated struct.
Method string
// The Go type of the field.
Type string
// String of arguments the method expects.
Params string
// String of arguments the method returns.
Results string
}
Field contains template data about a method in the Substate interface.
type TemplateData ¶
type TemplateData struct {
// The source of the go:generate directive.
Source string
// The package in which the output file will be written.
Package string
// The name of the generated type.
TypeName string
Imports []string
Fields []Field
}
TemplateData contains all data which is required by the template.
Click to show internal directories.
Click to hide internal directories.