# Packages
Package cli contains helpers used by transport-specific command-line client generators for parsing the command-line flags to identify the service and the method to make a request along with the request payload to be sent.
Package example contains code generation algorithms to produce an example server and client implementation for the transports defined in the design.
Package generator contains the code generation algorithms for a service server,
client, and OpenAPI specification.
Package service contains the code generation algorithms to produce code for the service and views packages and dummy implementation for the services defined in the design.
# Functions
AddImport adds imports to a section template that was generated with Header.
AddServiceMetaTypeImports adds meta type imports for each method of the service expr.
AppendHelpers takes care of only appending helper functions from newH that are not already in oldH.
AttributeTags computes the struct field tags from its metadata if any.
CamelCase produces the CamelCase version of the given string.
CommandLine return the command used to run this process.
Comment produces line comments by concatenating the given strings and producing 80 characters long lines starting with "//".
CreateTempFile creates a temporary file and writes the given content.
Diff returns a diff between s1 and s2.
FormatTestCode formats the given Go code.
GetMetaType retrieves the type and package defined by the struct:field:type metadata if any.
GetMetaTypeImports parses the attribute for all user defined imports.
Goify makes a valid Go identifier out of any string.
GoifyAtt honors any struct:field:name meta set on the attribute and calls Goify with the tag value if present or the given name otherwise.
GoNativeTypeName returns the Go built-in type corresponding to the given primitive type.
GoTransform produces Go code that initializes the data structure defined by target from an instance of the data structure described by source.
Header returns a Go source file header section template.
Indent inserts prefix at the beginning of each non-empty line of s.
InitStructFields produces Go code to initialize a struct and its fields from the given init arguments.
IsCompatible returns an error if a and b are not both objects, both arrays, both maps or both the same primitive type.
KebabCase produces the kebab-case version of the given CamelCase string.
MapDepth returns the level of nested maps.
NewAttributeContext initializes an attribute context.
NewAttributeScope initializes an attribute scope.
NewImport creates an import spec.
NewNameScope creates an empty name scope.
RecursiveValidationCode produces Go code that runs the validations defined in the given attribute and its children recursively against the value held by the variable named target.
RegisterPlugin adds the plugin to the list of plugins to be invoked with the given command.
RegisterPluginFirst adds the plugin to the beginning of the list of plugins to be invoked with the given command.
RegisterPluginLast adds the plugin to the end of the list of plugins to be invoked with the given command.
RunDSL returns the DSL root resulting from running the given DSL.
RunDSLWithFunc returns the DSL root resulting from running the given DSL.
RunPlugins executes the plugins registered with the given command in the order they were registered.
RunPluginsPrepare executes the plugins prepare functions in the order they were registered.
SectionCode generates and formats the code for the given section.
SectionCodeFromImportsAndMethods generates and formats the code for given import and method definition sections.
SectionsCode generates and formats the code for the given sections.
SimpleImport creates an import with no explicit path component.
SnakeCase produces the snake_case version of the given CamelCase string.
TemplateFuncs lists common template helper functions.
ValidationCode produces Go code that runs the validations defined in the given attribute definition if any against the content of the variable named target.
Walk traverses the data structure recursively and calls the given function once on each attribute starting with a.
WalkMappedAttr iterates over the mapped attributes.
WalkType traverses the data structure recursively and calls the given function once on each attribute starting with the user type attribute.
WrapText produces lines with text capped at maxChars it will keep words intact and respects newlines.
# Constants
Gendir is the name of the subdirectory of the output directory that contains the generated files.
# Type aliases
MappedAttributeWalker is the type of functions given to WalkMappedAttr.