lib

package
v0.0.0-...-75059c0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2014 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenPkg

func GenPkg(srcPath, dstRoot, name string, mock bool, cfg *MockConfig) (map[string]bool, error)

func GetImports

func GetImports(path string, tests bool) (map[string]bool, error)

func GetMockedPackages

func GetMockedPackages(path string) (map[string]string, error)

func GetOutput

func GetOutput(name string, args ...string) (string, error)

func LinkPkg

func LinkPkg(srcPath, dstRoot, name string) (map[string]bool, error)

func LookupImportPath

func LookupImportPath(impPath string) (string, error)

func MakePkg

func MakePkg(srcPath, dstPath string, mock bool, cfg *MockConfig) (map[string]bool, error)

MakePkg writes a mock version of the package found at srcPath into dstPath. If dstPath already exists, bad things will probably happen.

func MockImports

func MockImports(src, dst string, names map[string]string, cfg *Config) error

func MockInterfaces

func MockInterfaces(tmpPath, pkgName string, cfg *MockConfig) error

func MockStandard

func MockStandard(srcRoot, dstRoot, name string, cfg *MockConfig) error

func NewRewriter

func NewRewriter(w io.Writer) *rewriter

Types

type Config

type Config struct {
	Mocks map[string]*MockConfig
}

func ReadConfig

func ReadConfig(path string) (*Config, error)

func (*Config) Mock

func (c *Config) Mock(path string) *MockConfig

type Context

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

func NewContext

func NewContext() (*Context, error)

func (*Context) AddPackage

func (c *Context) AddPackage(pkgName string) (string, error)

func (*Context) Chdir

func (c *Context) Chdir(pkg string) error

func (*Context) Close

func (c *Context) Close() error

func (*Context) DisableRewrite

func (c *Context) DisableRewrite()

func (*Context) ExcludePackagesFromFile

func (c *Context) ExcludePackagesFromFile(path string) error

func (*Context) KeepWork

func (c *Context) KeepWork()

func (*Context) LinkPackage

func (c *Context) LinkPackage(pkg string) error

func (*Context) LinkPackagesFromFile

func (c *Context) LinkPackagesFromFile(path string) error

func (*Context) LoadConfig

func (c *Context) LoadConfig(path string) (err error)

func (*Context) Run

func (c *Context) Run(command string, args ...string) error

type Interfaces

type Interfaces map[string]*ifInfo

type MockConfig

type MockConfig struct {
	MOCK      string `yaml:"MOCK"`
	EXPECT    string `yaml:"EXPECT"`
	ObjEXPECT string `yaml:"obj.EXPECT"`
}

Jump to

Keyboard shortcuts

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