Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HeaderTemplate *template.Template TrailerTemplate *template.Template MessageTemplate *template.Template TagTemplate *template.Template FieldTemplate *template.Template EnumTemplate *template.Template )
View Source
var (
GlobalFieldTypes []*datadictionary.FieldType
)
Functions ¶
func BuildGlobalFieldTypes ¶
func BuildGlobalFieldTypes(specs []*datadictionary.DataDictionary)
func WriteFile ¶
WriteFile parses the generated code in fileOut and writes the code out to filePath. Function performs some import clean up and gofmts the code before writing Returns ParseError if the generated source is invalid but is written to filePath
Types ¶
type ErrorHandler ¶
type ErrorHandler struct {
ReturnCode int
}
ErrorHandler is a convenience struct for interpretting generation Errors
func (*ErrorHandler) Handle ¶
func (h *ErrorHandler) Handle(err error)
Handle interprets the generation error. Proceeds with setting returnCode, or panics depending on error type
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
ParseError indicates generated go source is invalid
func (ParseError) Error ¶
func (e ParseError) Error() string
Source Files
¶
- generate.go
- globals.go
- helpers.go
- template_helpers.go
- templates.go
Click to show internal directories.
Click to hide internal directories.