mocks

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnyLifetime = -1
	Anything    = mock.Anything
)

Variables

This section is empty.

Functions

func OnDelete

func OnDelete(config *ConfigurationContext, key string, returnError error)

OnDelete provides a helper function to mock the "Delete" method of a configuration context

func OnDeleteRecursive

func OnDeleteRecursive(config *ConfigurationContext, key string, returnError error)

OnDeleteRecursive provides a helper function to mock the "Delete" method of a configuration context

func OnExists

func OnExists(config *ConfigurationContext, key string, returnExists bool, returnError error)

OnExists provides a helper function to mock the "Exists" method of a configuration context

func OnGet

func OnGet(config *ConfigurationContext, key string, returnValue string, returnError error)

OnGet provides a helper function to mock the "Get" method of a configuration context

func OnGetOrFalse

func OnGetOrFalse(config *ConfigurationContext, key string, returnValue string, returnExists bool, returnError error)

OnGetOrFalse provides a helper function to mock the "GetOrFalse" method of a configuration context

func OnRefresh

func OnRefresh(config *ConfigurationContext, key string, ttl int, returnError error)

OnRefresh provides a helper function to mock the "Refresh" method of a configuration context

func OnRemoveAll

func OnRemoveAll(config *ConfigurationContext, returnError error)

OnRemoveAll provides a helper function to mock the "RemoveAll" method of a configuration context

func OnSet

func OnSet(config *ConfigurationContext, keyToSet string, valueToSet string, returnError error)

OnSet provides a helper function to mock the "Set" method of a configuration context

func OnSetWithLifetime

func OnSetWithLifetime(config *ConfigurationContext, key string, value string, ttl int, returnError error)

OnSetWithLifetime provides a helper function to mock the "SetWithLifetime" method of a configuration context

Types

type ConfigurationContext

type ConfigurationContext struct {
	mock.Mock
}

ConfigurationContext is an autogenerated mock type for the ConfigurationContext type

func NewConfigurationContext added in v0.8.0

func NewConfigurationContext(t mockConstructorTestingTNewConfigurationContext) *ConfigurationContext

NewConfigurationContext creates a new instance of ConfigurationContext. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*ConfigurationContext) Delete

func (_m *ConfigurationContext) Delete(key string) error

Delete provides a mock function with given fields: key

func (*ConfigurationContext) DeleteRecursive

func (_m *ConfigurationContext) DeleteRecursive(key string) error

DeleteRecursive provides a mock function with given fields: key

func (*ConfigurationContext) Exists

func (_m *ConfigurationContext) Exists(key string) (bool, error)

Exists provides a mock function with given fields: key

func (*ConfigurationContext) Get

func (_m *ConfigurationContext) Get(key string) (string, error)

Get provides a mock function with given fields: key

func (*ConfigurationContext) GetAll

func (_m *ConfigurationContext) GetAll() (map[string]string, error)

GetAll provides a mock function with given fields:

func (*ConfigurationContext) GetOrFalse

func (_m *ConfigurationContext) GetOrFalse(key string) (bool, string, error)

GetOrFalse provides a mock function with given fields: key

func (*ConfigurationContext) Refresh

func (_m *ConfigurationContext) Refresh(key string, timeToLiveInSeconds int) error

Refresh provides a mock function with given fields: key, timeToLiveInSeconds

func (*ConfigurationContext) RemoveAll

func (_m *ConfigurationContext) RemoveAll() error

RemoveAll provides a mock function with given fields:

func (*ConfigurationContext) Set

func (_m *ConfigurationContext) Set(key string, value string) error

Set provides a mock function with given fields: key, value

func (*ConfigurationContext) SetWithLifetime

func (_m *ConfigurationContext) SetWithLifetime(key string, value string, timeToLiveInSeconds int) error

SetWithLifetime provides a mock function with given fields: key, value, timeToLiveInSeconds

type DoguRegistry

type DoguRegistry struct {
	mock.Mock
}

DoguRegistry is an autogenerated mock type for the DoguRegistry type

func NewDoguRegistry added in v0.8.0

func NewDoguRegistry(t mockConstructorTestingTNewDoguRegistry) *DoguRegistry

NewDoguRegistry creates a new instance of DoguRegistry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*DoguRegistry) Enable

func (_m *DoguRegistry) Enable(dogu *core.Dogu) error

Enable provides a mock function with given fields: dogu

func (*DoguRegistry) Get

func (_m *DoguRegistry) Get(name string) (*core.Dogu, error)

Get provides a mock function with given fields: name

func (*DoguRegistry) GetAll

func (_m *DoguRegistry) GetAll() ([]*core.Dogu, error)

GetAll provides a mock function with given fields:

func (*DoguRegistry) IsEnabled

func (_m *DoguRegistry) IsEnabled(name string) (bool, error)

IsEnabled provides a mock function with given fields: name

func (*DoguRegistry) Register

func (_m *DoguRegistry) Register(dogu *core.Dogu) error

Register provides a mock function with given fields: dogu

func (*DoguRegistry) Unregister

func (_m *DoguRegistry) Unregister(name string) error

Unregister provides a mock function with given fields: name

type NewWatchConfigurationContextT added in v0.2.0

type NewWatchConfigurationContextT interface {
	mock.TestingT
	Cleanup(func())
}

type Registry

type Registry struct {
	mock.Mock
}

Registry is an autogenerated mock type for the Registry type

func NewRegistry added in v0.5.0

func NewRegistry(t mockConstructorTestingTNewRegistry) *Registry

NewRegistry creates a new instance of Registry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*Registry) BlueprintRegistry

func (_m *Registry) BlueprintRegistry() registry.ConfigurationContext

BlueprintRegistry provides a mock function with given fields:

func (*Registry) DoguConfig

func (_m *Registry) DoguConfig(dogu string) registry.ConfigurationContext

DoguConfig provides a mock function with given fields: dogu

func (*Registry) DoguRegistry

func (_m *Registry) DoguRegistry() registry.DoguRegistry

DoguRegistry provides a mock function with given fields:

func (*Registry) GetNode added in v0.5.0

func (_m *Registry) GetNode() (registry.Node, error)

GetNode provides a mock function with given fields:

func (*Registry) GlobalConfig

func (_m *Registry) GlobalConfig() registry.ConfigurationContext

GlobalConfig provides a mock function with given fields:

func (*Registry) HostConfig

func (_m *Registry) HostConfig(hostService string) registry.ConfigurationContext

HostConfig provides a mock function with given fields: hostService

func (*Registry) RootConfig added in v0.2.0

func (_m *Registry) RootConfig() registry.WatchConfigurationContext

RootConfig provides a mock function with given fields:

func (*Registry) State

func (_m *Registry) State(dogu string) registry.State

State provides a mock function with given fields: dogu

type RegistryMocks added in v0.5.0

type RegistryMocks struct {
	Registry      *Registry
	SubRegistries map[string]*ConfigurationContext
	DoguRegistry  *DoguRegistry
	WatchContext  *WatchConfigurationContext
	Node          registry.Node
}

func CreateMockRegistry

func CreateMockRegistry(doguRegs []string) RegistryMocks

CreateMockRegistry creates a mock registry containing default values for any sub-registry. The doguRegs parameter contains a list with all dogu registries that should be exist. Pass nil if you don't need any dogu registry. Note: AssertExpectations on the registry may fail because of the predefined expectations.

type WatchConfigurationContext added in v0.2.0

type WatchConfigurationContext struct {
	mock.Mock
}

WatchConfigurationContext is an autogenerated mock type for the WatchConfigurationContext type

func NewWatchConfigurationContext added in v0.2.0

func NewWatchConfigurationContext(t NewWatchConfigurationContextT) *WatchConfigurationContext

NewWatchConfigurationContext creates a new instance of WatchConfigurationContext. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*WatchConfigurationContext) Get added in v0.2.0

func (_m *WatchConfigurationContext) Get(key string) (string, error)

Get provides a mock function with given fields: key

func (*WatchConfigurationContext) GetChildrenPaths added in v0.2.0

func (_m *WatchConfigurationContext) GetChildrenPaths(key string) ([]string, error)

GetChildrenPaths provides a mock function with given fields: key

func (*WatchConfigurationContext) Watch added in v0.2.0

func (_m *WatchConfigurationContext) Watch(ctx context.Context, key string, recursive bool, eventChannel chan *client.Response)

Watch provides a mock function with given fields: ctx, key, recursive, eventChannel

Jump to

Keyboard shortcuts

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