Documentation
¶
Index ¶
- func GenPkg(srcPath, dstRoot, name string, mock bool, cfg *MockConfig) (map[string]bool, error)
- func GetImports(path string, tests bool) (map[string]bool, error)
- func GetMockedPackages(path string) (map[string]string, error)
- func GetOutput(name string, args ...string) (string, error)
- func LinkPkg(srcPath, dstRoot, name string) (map[string]bool, error)
- func LookupImportPath(impPath string) (string, error)
- func MakePkg(srcPath, dstPath string, mock bool, cfg *MockConfig) (map[string]bool, error)
- func MockImports(src, dst string, names map[string]string, cfg *Config) error
- func MockInterfaces(tmpPath, pkgName string, cfg *MockConfig) error
- func MockStandard(srcRoot, dstRoot, name string, cfg *MockConfig) error
- func NewRewriter(w io.Writer) *rewriter
- type Config
- type Context
- func (c *Context) AddPackage(pkgName string) (string, error)
- func (c *Context) Chdir(pkg string) error
- func (c *Context) Close() error
- func (c *Context) DisableRewrite()
- func (c *Context) ExcludePackagesFromFile(path string) error
- func (c *Context) KeepWork()
- func (c *Context) LinkPackage(pkg string) error
- func (c *Context) LinkPackagesFromFile(path string) error
- func (c *Context) LoadConfig(path string) (err error)
- func (c *Context) Run(command string, args ...string) error
- type Interfaces
- type MockConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookupImportPath ¶
func MakePkg ¶
MakePkg writes a mock version of the package found at srcPath into dstPath. If dstPath already exists, bad things will probably happen.
func MockInterfaces ¶
func MockInterfaces(tmpPath, pkgName string, cfg *MockConfig) error
func MockStandard ¶
func MockStandard(srcRoot, dstRoot, name string, cfg *MockConfig) error
func NewRewriter ¶
Types ¶
type Config ¶
type Config struct {
Mocks map[string]*MockConfig
}
func ReadConfig ¶
func (*Config) Mock ¶
func (c *Config) Mock(path string) *MockConfig
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func (*Context) DisableRewrite ¶
func (c *Context) DisableRewrite()
func (*Context) ExcludePackagesFromFile ¶
func (*Context) LinkPackage ¶
func (*Context) LinkPackagesFromFile ¶
func (*Context) LoadConfig ¶
type Interfaces ¶
type Interfaces map[string]*ifInfo
type MockConfig ¶
Click to show internal directories.
Click to hide internal directories.