Versions in this module Expand all Collapse all v1 v1.0.0 Aug 2, 2016 Changes in this version + const TransformMapKey + var DefaultFuncMap = template.FuncMap + var Reserved = map[string]bool + var TempCount int + func Add(a, b int) int + func BuiltInTypeName(mt *design.MediaTypeDefinition) string + func CanonicalParams(r *design.ResourceDefinition) []string + func CanonicalTemplate(r *design.ResourceDefinition) string + func CheckVersion(ver string) error + func CommandLine() string + func Comment(elems ...string) string + func GoNativeType(t design.DataType) string + func GoTypeDef(ds design.DataStructure, tabs int, jsonTags, private bool) string + func GoTypeDesc(t design.DataType, upper bool) string + func GoTypeName(t design.DataType, required []string, tabs int, private bool) string + func GoTypeRef(t design.DataType, required []string, tabs int, private bool) string + func GoTypeTransform(source, target *design.UserTypeDefinition, targetPkg, funcName string) (string, error) + func GoTypeTransformName(source, target *design.UserTypeDefinition, suffix string) string + func Goify(str string, firstUpper bool) string + func GoifyAtt(att *design.AttributeDefinition, name string, firstUpper bool) string + func Indent(s, prefix string) string + func IndentBytes(b, prefix []byte) []byte + func PackageName(path string) (string, error) + func PackagePath(path string) (string, error) + func PackageSourcePath(pkg string) (string, error) + func Publicizer(att *design.AttributeDefinition, sourceField, targetField string, ...) string + func RecursiveChecker(att *design.AttributeDefinition, nonzero, required, hasDefault bool, ...) string + func RecursiveFinalizer(att *design.AttributeDefinition, target string, depth int, ...) string + func RecursivePublicizer(att *design.AttributeDefinition, source, target string, depth int) string + func RunTemplate(tmpl *template.Template, data interface{}) string + func SnakeCase(name string) string + func Tabs(depth int) string + func Tempvar() string + func ValidationChecker(att *design.AttributeDefinition, nonzero, required, hasDefault bool, ...) string + func WriteTabs(buf *bytes.Buffer, count int) + type ImportSpec struct + Name string + Path string + func NewImport(name, path string) *ImportSpec + func SimpleImport(path string) *ImportSpec + func (s *ImportSpec) Code() string + type Package struct + Path string + Workspace *Workspace + func PackageFor(source string) (*Package, error) + func (p *Package) Abs() string + func (p *Package) Compile(bin string) (string, error) + func (p *Package) CreateSourceFile(name string) *SourceFile + type SourceFile struct + Name string + Package *Package + func SourceFileFor(path string) (*SourceFile, error) + func (f *SourceFile) Abs() string + func (f *SourceFile) ExecuteTemplate(name, source string, funcMap template.FuncMap, data interface{}) error + func (f *SourceFile) FormatCode() error + func (f *SourceFile) Write(b []byte) (int, error) + func (f *SourceFile) WriteHeader(title, pack string, imports []*ImportSpec) error + type Workspace struct + Path string + func NewWorkspace(prefix string) (*Workspace, error) + func WorkspaceFor(source string) (*Workspace, error) + func (w *Workspace) Delete() + func (w *Workspace) NewPackage(goPath string) (*Package, error) + func (w *Workspace) Reset() error