Documentation
¶
Overview ¶
Package generator is a package that defines how code should be generated.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateByType ¶
func GenerateByType(opts GenerateOptions) ([]byte, error)
GenerateByType generates the code for the optional type.
func InitializeTemplates ¶
func InitializeTemplates()
InitializeTemplates initializes the templates, should be called at the start of the main program loop.
Types ¶
type GenerateOptions ¶
type GenerateOptions struct {
// TypeName is the name of the type to generate optional to.
TypeName string
// ExtCode is the extension code.
ExtCode int
// PackageName is the name of the package to generate to.
PackageName string
// Imports is the list of imports to add to the generated code.
Imports []string
// CustomMarshalFunc is the name of the custom marshal function.
CustomMarshalFunc string
// CustomUnmarshalFunc is the name of the custom unmarshal function.
CustomUnmarshalFunc string
}
GenerateOptions is the options for the code generation.
Click to show internal directories.
Click to hide internal directories.