Documentation ¶
Index ¶
- func SourceMode(source string) (*model.Package, error)
- type Generator
- func (g *Generator) Generate(pkg *model.Package, outputPkgName string, outputPackagePath string) error
- func (g *Generator) GenerateMockInterface(intf *model.Interface, outputPackagePath string) error
- func (g *Generator) GenerateMockMethod(mockType string, m *model.Method, pkgOverride string) error
- func (g *Generator) GenerateMockMethods(mockType string, intf *model.Interface, pkgOverride string)
- func (g *Generator) GenerateMockRecorderMethod(mockType string, m *model.Method) error
- func (g *Generator) Output() []byte
- type GeneratorOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator to generate mock file
func NewGenerator ¶
func NewGenerator(generatorOptions ...GeneratorOption) *Generator
NewGenerator return a Generator Point
func (*Generator) Generate ¶
func (g *Generator) Generate(pkg *model.Package, outputPkgName string, outputPackagePath string) error
Generate gen the mock file
func (*Generator) GenerateMockInterface ¶
GenerateMockInterface ...
func (*Generator) GenerateMockMethod ¶
GenerateMockMethod generates a mock method implementation. If non-empty, pkgOverride is the package in which unqualified types reside.
func (*Generator) GenerateMockMethods ¶
GenerateMockMethods ...
func (*Generator) GenerateMockRecorderMethod ¶
GenerateMockRecorderMethod ...
type GeneratorOption ¶
type GeneratorOption func(g *Generator)
GeneratorOption change the Generator Option
func OptGeneratorFilename ¶
func OptGeneratorFilename(filename string) GeneratorOption
OptGeneratorFilename change the Generator Prop of filename
Click to show internal directories.
Click to hide internal directories.