Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
Generator is responsible for generating validation files for the given in a go source file.
func NewGenerator ¶
NewGenerator is a constructor method for creating a new Generator with default templates loaded.
func (*Generator) GenerateEnums ¶
GenerateEnums renders the Go code of the enums.
func (*Generator) Initialize ¶
Initialize builds an index of the supplied values, calculating things like names and offsets.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a type that allows for Renderers to be bundled together and have operations performed in parallel on them.
func NewDefaultRegistry ¶
func NewDefaultRegistry() *Registry
NewDefaultRegistry returns a registry with access to all plugins within the renum library.
func NewEmptyRegistry ¶
func NewEmptyRegistry() *Registry
NewEmptyRegistry creates a registry with an empty Plugin table.
func NewRegistryWithPlugins ¶
func NewRegistryWithPlugins(c ...plugins.Constructor) *Registry
NewRegistryWithPlugins is used to create a pre-populated plugin registry by giving this constructor a list of plugins.Constructor types to create each plugin.
func (*Registry) Assemble ¶
Assemble is used to create the fully assembled Go source file containing the generated enum and all it's implementations.
func (*Registry) Build ¶
Build iterates all Plugin plugins to determine if they should be enabled, removing any that should not be enabled. For any remaining, it performs validation to ensure the Plugin plugin is compatible with the provided configuration, then called the Render() function to construct the code segment for that plugin.