Documentation ¶
Overview ¶
generator package is responsible for parsing the file and generating the enum go file. It uses the ast package to parse the file and generate the enum go file from the parsed information. The EnumRepresentation struct is the struct to store the information that is to be used in writing the enum to a file. ParseAndGenerate function to parse the file and generate the enum go file for the enum type with failfast mode flag. Provides the failfast mode flag to enable failfast mode. This mode is 'error on invalid' and will error instead of generating an enum class as 'Invalid' when Parsed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrFailedToParseFile = fmt.Errorf("failed to parse file")
ErrFailedToParseFile is an error returned when the file cannot be parsed.
Functions ¶
func ParseAndGenerate ¶ added in v0.2.0
ParseAndGenerate parses the file and generates the enum go file for the enum type with failfast mode flag.
Types ¶
type Enum ¶
type Enum struct { Info info TypeInfo typeInfo Raw raw }
Enum is a struct to store the information for each enum to be written.
type EnumRepresentation ¶ added in v0.2.0
EnumRepresentation is a struct to store the information to be used in writing the enum to a file.