Documentation ¶
Overview ¶
Package ensurefile assists with loading and representing .ensure.yml files.
Index ¶
Constants ¶
View Source
const ExampleFile = `` /* 784-byte string literal not displayed */
ExampleFile for use in error messages and CLI help menus.
Variables ¶
View Source
var ( ErrCannotFindGoModule = erk.New(ErkCannotLoadConfig{}, "Cannot find root go.mod file by searching parent working directories") ErrCannotParseGoModule = erk.New(ErkCannotLoadConfig{}, "Cannot read module path from go.mod file: {{.path}}") ErrCannotOpenFile = erk.New(ErkCannotLoadConfig{}, "Cannot open the file '{{.path}}': {{.err}}") ErrCannotUnmarshalFile = erk.New(ErkCannotLoadConfig{}, "Cannot parse the file '{{.path}}': {{.err}}") )
View Source
var ( ErrMissingMockConfig = erk.New(ErkInvalidConfig{}, "Missing `mocks` config in .ensure.yml file. For example:\n\n"+ExampleFile) ErrMissingPackages = erk.New(ErkInvalidConfig{}, "No mocks to generate. Please add some to `mocks.packages` in .ensure.yml file. For example:\n\n"+ExampleFile, ) ErrDuplicatePackagePath = erk.New(ErkInvalidConfig{}, "Found duplicate package path: {{.packagePath}} in .ensure.yml file. Package paths must be unique.") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { RootPath string `yaml:"-"` ModulePath string `yaml:"-"` Mocks *MockConfig `yaml:"mocks"` }
Config is the root of the .ensure.yml file.
type ErkCannotLoadConfig ¶
type ErkCannotLoadConfig struct{ erk.DefaultKind }
type ErkInvalidConfig ¶
type ErkInvalidConfig struct{ erk.DefaultKind }
type LoaderIface ¶
LoaderIface allows loading the project's .ensure.yml file.
type MockConfig ¶
type MockConfig struct { PrimaryDestination string `yaml:"primaryDestination"` InternalDestination string `yaml:"internalDestination"` TidyAfterGenerate bool `yaml:"-"` RawTidyAfterGenerate *bool `yaml:"tidyAfterGenerate"` Packages []*MockPackage `yaml:"packages"` }
MockConfig is configuration related to mocks.
type MockPackage ¶
MockPackage is configuration related to mocking a single package.
func (*MockPackage) String ¶
func (pkg *MockPackage) String() string
String exposes the Package as `<Path>:<Interfaces[0]>,<Interfaces[1]>,...`.
Click to show internal directories.
Click to hide internal directories.