Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingMockConfig = erk.New(ErkInvalidConfig{}, "Missing `mocks` config in .ensure.yml file. For example:\n\n"+ensurefile.ExampleFile) ErrMissingPackages = erk.New(ErkInvalidConfig{}, "No mocks to generate. Please add some to `mocks.packages` in .ensure.yml file. For example:\n\n"+ensurefile.ExampleFile, ) ErrDuplicatePackagePath = erk.New(ErkInvalidConfig{}, "Found duplicate package path: {{.packagePath}}. Package paths must be unique.") ErrMissingPackagePath = erk.New(ErkInvalidConfig{}, "Missing `path` key for package.") ErrMissingPackageInterfaces = erk.New(ErkInvalidConfig{}, "Package '{{.packagePath}}' has no interfaces to generate. Please add them using the `interfaces` key.", ) ErrMultipleGenerationFailures = erk.New(ErkMultipleFailures{}, "Unable to generate at least one mock") ErrMockGenFailed = erk.New(ErkMockGenError{}, "Could not run mockgen successfully for '{{.packageDescription}}': {{.err}}") ErrUnableToCreateDir = erk.New(ErkFSWriteError{}, "Could not create directory '{{.path}}': {{.err}}") ErrUnableToCreateFile = erk.New(ErkFSWriteError{}, "Could not create file '{{.path}}': {{.err}}") )
View Source
var ( ErrTidyUnableToList = erk.New(ErkUnableToTidy{}, "Could not list files recursively for '{{.path}}': {{.err}}") ErrTidyUnableToCleanup = erk.New(ErkUnableToTidy{}, "Could not delete '{{.path}}': {{.err}}") )
View Source
var ErrInternalPackageOutsideModule = erk.New(ErkMockDestination{},
"Cannot generate mock of internal package, since package '{{.packagePath}}' is not in the current module '{{.modulePath}}'",
)
Functions ¶
This section is empty.
Types ¶
type ErkFSWriteError ¶
type ErkFSWriteError struct{ erk.DefaultKind }
type ErkInvalidConfig ¶
type ErkInvalidConfig struct{ erk.DefaultKind }
type ErkMockDestination ¶
type ErkMockDestination struct{ erk.DefaultKind }
type ErkMockGenError ¶
type ErkMockGenError struct{ erk.DefaultKind }
type ErkMultipleFailures ¶ added in v0.1.1
type ErkMultipleFailures struct{ erk.DefaultKind }
type ErkUnableToTidy ¶ added in v0.1.4
type ErkUnableToTidy struct{ erk.DefaultKind }
type MockGen ¶ added in v0.1.4
type MockGen struct { CmdRun runcmd.RunnerIface FSWrite fswrite.FSWriteIface Logger *log.Logger Cleanup exitcleanup.ExitCleaner }
func (*MockGen) GenerateMocks ¶ added in v0.1.4
GenerateMocks for the provided configuration.
type MockGenerator ¶ added in v0.1.4
type MockGenerator interface { GenerateMocks(ctx context.Context, config *ensurefile.Config) error TidyMocks(config *ensurefile.Config) error }
Click to show internal directories.
Click to hide internal directories.