Versions in this module Expand all Collapse all v0 v0.1.1 Nov 14, 2021 Changes in this version + const GolangFileType + func NewImportTracker(typesToAdd ...*types.Type) namer.ImportTracker + type Args map[interface{}]interface + func (a Args) With(key, value interface{}) Args + func (a Args) WithArgs(rhs Args) Args + type Context struct + FileTypes map[string]FileType + Inputs []string + Namers namer.NameSystems + Order []*types.Type + Universe types.Universe + Verify bool + func NewContext(b *parser.Builder, nameSystems namer.NameSystems, canonicalOrderName string) (*Context, error) + func (c *Context) ExecutePackage(outDir string, p Package) error + func (c *Context) ExecutePackages(outDir string, packages Packages) error + func (ctxt *Context) AddDir(path string) error + func (ctxt *Context) AddDirectory(path string) (*types.Package, error) + func (ctxt *Context) IncomingImports() map[string][]string + func (ctxt *Context) TransitiveIncomingImports() map[string][]string + type DefaultFileType struct + Assemble func(io.Writer, *File) + Format func([]byte) ([]byte, error) + func NewGolangFile() *DefaultFileType + func (ft DefaultFileType) AssembleFile(f *File, pathname string) error + func (ft DefaultFileType) VerifyFile(f *File, pathname string) error + type DefaultGen struct + OptionalBody []byte + OptionalName string + func (d DefaultGen) FileType() string + func (d DefaultGen) Filename() string + func (d DefaultGen) Filter(*Context, *types.Type) bool + func (d DefaultGen) Finalize(*Context, io.Writer) error + func (d DefaultGen) GenerateType(*Context, *types.Type, io.Writer) error + func (d DefaultGen) Imports(*Context) []string + func (d DefaultGen) Init(c *Context, w io.Writer) error + func (d DefaultGen) Name() string + func (d DefaultGen) Namers(*Context) namer.NameSystems + func (d DefaultGen) PackageConsts(*Context) []string + func (d DefaultGen) PackageVars(*Context) []string + type DefaultPackage struct + FilterFunc func(*Context, *types.Type) bool + GeneratorFunc func(*Context) []Generator + GeneratorList []Generator + HeaderText []byte + PackageDocumentation []byte + PackageName string + PackagePath string + Source string + func (d *DefaultPackage) Filter(c *Context, t *types.Type) bool + func (d *DefaultPackage) Generators(c *Context) []Generator + func (d *DefaultPackage) Header(filename string) []byte + func (d *DefaultPackage) Name() string + func (d *DefaultPackage) Path() string + func (d *DefaultPackage) SourcePath() string + type ErrorTracker struct + func NewErrorTracker(w io.Writer) *ErrorTracker + func (et *ErrorTracker) Error() error + func (et *ErrorTracker) Write(p []byte) (n int, err error) + type File struct + Body bytes.Buffer + Consts bytes.Buffer + FileType string + Header []byte + Imports map[string]struct{} + Name string + PackageName string + PackagePath string + PackageSourcePath string + Vars bytes.Buffer + type FileType interface + AssembleFile func(f *File, path string) error + VerifyFile func(f *File, path string) error + type Generator interface + FileType func() string + Filename func() string + Filter func(*Context, *types.Type) bool + Finalize func(*Context, io.Writer) error + GenerateType func(*Context, *types.Type, io.Writer) error + Imports func(*Context) []string + Init func(*Context, io.Writer) error + Name func() string + Namers func(*Context) namer.NameSystems + PackageConsts func(*Context) []string + PackageVars func(*Context) []string + type Package interface + Filter func(*Context, *types.Type) bool + Generators func(*Context) []Generator + Header func(filename string) []byte + Name func() string + Path func() string + SourcePath func() string + type Packages []Package + type SnippetWriter struct + func NewSnippetWriter(w io.Writer, c *Context, left, right string) *SnippetWriter + func (s *SnippetWriter) Do(format string, args interface{}) *SnippetWriter + func (s *SnippetWriter) Error() error + func (s *SnippetWriter) Out() io.Writer