Documentation ¶
Overview ¶
Package test implements a mock namespace reflection and namespace translation mechanism
Index ¶
- func NewMockNamespaceMapperController(mapper *MockNamespaceMapper) namespacesmapping.MapperController
- type MockNamespaceMapper
- func (m *MockNamespaceMapper) Clear()
- func (m *MockNamespaceMapper) DeNatNamespace(namespace string) (string, error)
- func (m *MockNamespaceMapper) MappedNamespaces() map[string]string
- func (m *MockNamespaceMapper) NatNamespace(namespace string) (string, error)
- func (m *MockNamespaceMapper) NewNamespace(namespace string)
- type MockNamespaceMapperController
- func (c *MockNamespaceMapperController) DeNatNamespace(namespace string) (string, error)
- func (c *MockNamespaceMapperController) MappedNamespaces() map[string]string
- func (c *MockNamespaceMapperController) NatNamespace(namespace string) (string, error)
- func (c *MockNamespaceMapperController) PollStartIncomingReflection() chan string
- func (c *MockNamespaceMapperController) PollStartMapper() chan struct{}
- func (c *MockNamespaceMapperController) PollStartOutgoingReflection() chan string
- func (c *MockNamespaceMapperController) PollStopIncomingReflection() chan string
- func (c *MockNamespaceMapperController) PollStopMapper() chan struct{}
- func (c *MockNamespaceMapperController) PollStopOutgoingReflection() chan string
- func (c *MockNamespaceMapperController) ReadyForRestart()
- func (c *MockNamespaceMapperController) WaitForSync()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockNamespaceMapperController ¶
func NewMockNamespaceMapperController(mapper *MockNamespaceMapper) namespacesmapping.MapperController
NewMockNamespaceMapperController builds and returns a new mock NewNamespaceMapperController.
Types ¶
type MockNamespaceMapper ¶
MockNamespaceMapper implements a mock namespace mapping mechanism.
func (*MockNamespaceMapper) Clear ¶
func (m *MockNamespaceMapper) Clear()
Clear is a function used in tests only to clear the mock's state.
func (*MockNamespaceMapper) DeNatNamespace ¶
func (m *MockNamespaceMapper) DeNatNamespace(namespace string) (string, error)
DeNatNamespace handle the foreign to home namespace translation. It returns an error if the mapping is not found.
func (*MockNamespaceMapper) MappedNamespaces ¶
func (m *MockNamespaceMapper) MappedNamespaces() map[string]string
MappedNamespaces returns the entire namespace mapping map.
func (*MockNamespaceMapper) NatNamespace ¶
func (m *MockNamespaceMapper) NatNamespace(namespace string) (string, error)
NatNamespace handle the home to foreign namespace translation. It returns an error if the mapping is not found.
func (*MockNamespaceMapper) NewNamespace ¶
func (m *MockNamespaceMapper) NewNamespace(namespace string)
NewNamespace creates a new namespace in the local cache.
type MockNamespaceMapperController ¶
type MockNamespaceMapperController struct {
Mapper *MockNamespaceMapper
}
MockNamespaceMapperController implements a mock namespace mapper controller.
func (*MockNamespaceMapperController) DeNatNamespace ¶
func (c *MockNamespaceMapperController) DeNatNamespace(namespace string) (string, error)
DeNatNamespace handle the foreign to home namespace translation. It returns an error if the mapping is not found.
func (*MockNamespaceMapperController) MappedNamespaces ¶
func (c *MockNamespaceMapperController) MappedNamespaces() map[string]string
MappedNamespaces returns the entire namespace mapping map.
func (*MockNamespaceMapperController) NatNamespace ¶
func (c *MockNamespaceMapperController) NatNamespace(namespace string) (string, error)
NatNamespace handle the home to foreign namespace translation. It returns an error if the mapping is not found.
func (*MockNamespaceMapperController) PollStartIncomingReflection ¶
func (c *MockNamespaceMapperController) PollStartIncomingReflection() chan string
PollStartIncomingReflection returns the startIncomingReflection channel. It is used to receive elements to start new incoming reflection routines on pushed namespace names.
func (*MockNamespaceMapperController) PollStartMapper ¶
func (c *MockNamespaceMapperController) PollStartMapper() chan struct{}
PollStartMapper returns the startMapper channel.
func (*MockNamespaceMapperController) PollStartOutgoingReflection ¶
func (c *MockNamespaceMapperController) PollStartOutgoingReflection() chan string
PollStartOutgoingReflection returns the startOutgoingReflection channel. It is used to receive elements to start new outgoing reflection routines on pushed namespace names.
func (*MockNamespaceMapperController) PollStopIncomingReflection ¶
func (c *MockNamespaceMapperController) PollStopIncomingReflection() chan string
PollStopIncomingReflection returns the stopIncomingReflection channel. It is used to receive elements to stop new incoming reflection routines on pushed namespace names.
func (*MockNamespaceMapperController) PollStopMapper ¶
func (c *MockNamespaceMapperController) PollStopMapper() chan struct{}
PollStopMapper returns the stopMapper channel.
func (*MockNamespaceMapperController) PollStopOutgoingReflection ¶
func (c *MockNamespaceMapperController) PollStopOutgoingReflection() chan string
PollStopOutgoingReflection returns the stopOutgoingReflectionMapper channel. It is used to receive elements to stop new outgoing reflection routines on pushed namespace names.
func (*MockNamespaceMapperController) ReadyForRestart ¶
func (c *MockNamespaceMapperController) ReadyForRestart()
ReadyForRestart emits a signal to restart the OutgoingReflection.
func (*MockNamespaceMapperController) WaitForSync ¶
func (c *MockNamespaceMapperController) WaitForSync()
WaitForSync waits until internal caches are synchronized.