Documentation ¶
Index ¶
- func GetImportPathRoot() string
- func HeaderTrailerPkg(pkg string) string
- func WriteComponentImports(writer io.Writer, pkg string, parts []datadictionary.MessagePart) error
- func WriteFieldDeclarations(fixSpecMajor int, fixSpecMinor int, parts []datadictionary.MessagePart, ...) (s string)
- func WriteFieldSetters(writer io.Writer, receiver string, parts []datadictionary.MessagePart) error
- func WriteFile(filePath, fileOut string) error
- func WriteGroupDeclaration(fixSpecMajor, fixSpecMinor int, field *datadictionary.FieldDef, parent string) (fileOut string)
- func WriteMessageImports(writer io.Writer, pkg string, parts []datadictionary.MessagePart) error
- func WriteNewComponent(writer io.Writer, comp datadictionary.ComponentType) error
- func WriteNewMessage(writer io.Writer, msg datadictionary.MessageDef) error
- func WritePackage(writer io.Writer, pkg string) error
- type ErrorHandler
- type ParseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetImportPathRoot ¶
func GetImportPathRoot() string
GetImportPathRoot returns the root path to use in import statements. The root path is determined by stripping "$GOPATH/src/" from the current working directory. For example, when generating code within the QuickFIX/Go source tree, the returned root path will be "github.com/quickfixgo/quickfix".
func HeaderTrailerPkg ¶
func WriteComponentImports ¶
func WriteComponentImports(writer io.Writer, pkg string, parts []datadictionary.MessagePart) error
func WriteFieldDeclarations ¶
func WriteFieldDeclarations(fixSpecMajor int, fixSpecMinor int, parts []datadictionary.MessagePart, componentName string) (s string)
func WriteFieldSetters ¶
func WriteFieldSetters(writer io.Writer, receiver string, parts []datadictionary.MessagePart) error
WriteFieldSetters generates setters appropriate for Messages, Components or Repeating Groups
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
func WriteGroupDeclaration ¶
func WriteGroupDeclaration(fixSpecMajor, fixSpecMinor int, field *datadictionary.FieldDef, parent string) (fileOut string)
func WriteMessageImports ¶
func WriteMessageImports(writer io.Writer, pkg string, parts []datadictionary.MessagePart) error
func WriteNewComponent ¶
func WriteNewComponent(writer io.Writer, comp datadictionary.ComponentType) error
func WriteNewMessage ¶
func WriteNewMessage(writer io.Writer, msg datadictionary.MessageDef) error
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