internal

package
v0.6.1-0...-3be8a05 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2018 License: Apache-1.1 Imports: 13 Imported by: 0

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

func WriteFile(filePath, fileOut string) error

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

Jump to

Keyboard shortcuts

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