Versions in this module Expand all Collapse all v2 v2.14.3 Sep 29, 2022 Changes in this version + var ErrNotInterface = errors.New("expression not an interface") + var ErrNotSetup = errors.New("not setup") + type Cleanup func() error + type FileOutputStreamProvider struct + BaseDir string + Case string + Config config.Config + FileName string + InPackage bool + KeepTree bool + KeepTreeOriginalDirectory string + TestOnly bool + func (p *FileOutputStreamProvider) GetWriter(ctx context.Context, iface *Interface) (io.Writer, error, Cleanup) + type Generator struct + func NewGenerator(ctx context.Context, c config.Config, iface *Interface, pkg string) *Generator + func (g *Generator) Generate(ctx context.Context) error + func (g *Generator) GenerateBoilerplate(boilerplate string) + func (g *Generator) GeneratePrologue(ctx context.Context, pkg string) + func (g *Generator) GeneratePrologueNote(note string) + func (g *Generator) Write(w io.Writer) error + type GeneratorVisitor struct + Boilerplate string + InPackage bool + Note string + Osp OutputStreamProvider + PackageName string + PackageNamePrefix string + StructName string + func (v *GeneratorVisitor) VisitWalk(ctx context.Context, iface *Interface) error + type Interface struct + ActualInterface *types.Interface + File *ast.File + FileName string + IsFunction bool + Name string + NamedType *types.Named + Pkg *types.Package + QualifiedName string + SingleFunction *Method + func (iface *Interface) Methods() []*Method + type Method struct + Name string + Signature *types.Signature + type NodeVisitor struct + func NewNodeVisitor() *NodeVisitor + func (nv *NodeVisitor) DeclaredInterfaces() []string + func (nv *NodeVisitor) Visit(node ast.Node) ast.Visitor + type OutputStreamProvider interface + GetWriter func(context.Context, *Interface) (io.Writer, error, Cleanup) + type Parser struct + func NewParser(buildTags []string) *Parser + func (p *Parser) Find(name string) (*Interface, error) + func (p *Parser) Interfaces() []*Interface + func (p *Parser) Load() error + func (p *Parser) Parse(ctx context.Context, path string) error + type StdoutStreamProvider struct + func (*StdoutStreamProvider) GetWriter(ctx context.Context, iface *Interface) (io.Writer, error, Cleanup) + type Walker struct + BaseDir string + BuildTags []string + Filter *regexp.Regexp + LimitOne bool + Recursive bool + func (w *Walker) Walk(ctx context.Context, visitor WalkerVisitor) (generated bool) + type WalkerVisitor interface + VisitWalk func(context.Context, *Interface) error