Documentation ¶
Overview ¶
Package mock implements a VersionResolver implementation for use in testing. This implementation returns static data only and is not meant to be used outside of testing environments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type VersionResolver ¶
type VersionResolver struct { // Version is the version the resolver will return Version string // GetLatestVersionReturnsErr return an error when calling the mock function // GetLatestVersion GetLatestVersionReturnsErr bool // GetLatestVersionErrorMsg error message to return if GetLatestVersionReturnsErr // is set to true GetLatestVersionErrorMsg string // GetVersionResolverConfigReturnsErr returns an error when calling the mock function // GetVersionResolverConfig GetVersionResolverConfigReturnsErr bool // GetVersionResolverConfigErrorMsg error message to return if GetVersionResolverConfigReturnsErr // is set to true GetVersionResolverConfigErrorMsg string // SearchMockVersionResolverList searches the map of mock resolvers rather than returning // the current instance SearchMockVersionResolverList bool // MockVersionResolverList is a list of version resolvers we want to mock MockVersionResolverList map[string]VersionResolver }
func (*VersionResolver) GetLatestVersion ¶
func (v *VersionResolver) GetLatestVersion(ctx context.Context, log logrus.FieldLogger, appName, applicationType string) (string, error)
GetLatestVersion mocks the function the retrieves the latest version from a resolver
func (*VersionResolver) MockGetVersionResolverConfig ¶
func (v *VersionResolver) MockGetVersionResolverConfig(versionResolverType types.VersionResolverName) (types.VersionResolver, error)
MockGetVersionResolverConfig mocks the function that gets the resolver
Click to show internal directories.
Click to hide internal directories.