generator

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateEnumTypes

func GenerateEnumTypes(options Options, enums ...StringEnumDefinition)

GenerateEnumTypes scaffolds enum types for the given options and definitions

Types

type Options

type Options struct {
	// Filesystem path of the directory corresponding to the package to be used or created
	PackageDirectoryPath string
	// Import path of the package to be used or created. It must be a valid path according to the working module structure
	PackageImportPath string
	// Whether to omit the generated code header on files. Default value is false
	OmitGeneratedNotice bool
	// Whether to omit tests for generated code. Default value is false
	OmitTests bool
	// Whether to omit generated source code formatting, which also detects compilation errors. Default value is false
	OmitSourceFormatting bool
	// Whether to omit field name sanitization, which prevents invalid name qualifiers during code generation. Default value is false
	OmitNameSanitization bool
}

Options defined the options to be passed to the generator to configure certain aspects of the code generation

type StringEnumDefinition

type StringEnumDefinition struct {
	Name   string
	Values []string
}

StringEnumDefinition is the basic name:values definition of an enumeration. As the name implies, this is for string enumerations only

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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