mockery

package
v0.0.0-...-29089e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2016 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotInterface = errors.New("expression not an interface")
View Source
var ErrNotSetup = errors.New("not setup")

Functions

This section is empty.

Types

type Cleanup

type Cleanup func() error

type FileOutputStreamProvider

type FileOutputStreamProvider struct {
	BaseDir   string
	InPackage bool
	TestOnly  bool
	Case      string
}

func (*FileOutputStreamProvider) GetWriter

func (this *FileOutputStreamProvider) GetWriter(iface *Interface, pkg string) (io.Writer, error, Cleanup)

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(iface *Interface, pkg string) *Generator

func (*Generator) Generate

func (g *Generator) Generate() error

func (*Generator) GenerateIPPrologue

func (g *Generator) GenerateIPPrologue()

func (*Generator) GeneratePrologue

func (g *Generator) GeneratePrologue(pkg string)

func (*Generator) GeneratePrologueNote

func (g *Generator) GeneratePrologueNote(note string)

func (*Generator) Write

func (g *Generator) Write(w io.Writer) error

type GeneratorVisitor

type GeneratorVisitor struct {
	InPackage bool
	Note      string
	Osp       OutputStreamProvider
}

func (*GeneratorVisitor) VisitWalk

func (this *GeneratorVisitor) VisitWalk(iface *Interface) error

type Interface

type Interface struct {
	Name string
	Path string
	File *ast.File
	Pkg  *types.Package
	Type *types.Interface
}

type OutputStreamProvider

type OutputStreamProvider interface {
	GetWriter(iface *Interface, pkg string) (io.Writer, error, Cleanup)
}

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser() *Parser

func (*Parser) Find

func (p *Parser) Find(name string) (*Interface, error)

func (*Parser) Interfaces

func (p *Parser) Interfaces() []*Interface

func (*Parser) Parse

func (p *Parser) Parse(path string) error

type StdoutStreamProvider

type StdoutStreamProvider struct {
}

func (*StdoutStreamProvider) GetWriter

func (this *StdoutStreamProvider) GetWriter(iface *Interface, pkg string) (io.Writer, error, Cleanup)

type Walker

type Walker struct {
	BaseDir   string
	Recursive bool
	Filter    *regexp.Regexp
	LimitOne  bool
}

func (*Walker) Walk

func (this *Walker) Walk(visitor WalkerVisitor) (generated bool)

type WalkerVisitor

type WalkerVisitor interface {
	VisitWalk(*Interface) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL