Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fn ¶
type Registry ¶
type Registry interface {
Find(ctx context.Context, matchers ...RegistryMatcherFunc) ([]RegistryItem, error)
}
type RegistryItem ¶
type RegistryMatcherFunc ¶
type RegistryMatcherFunc func(r *registry) []RegistryItem
func FindByFunctionID ¶
func FindByFunctionID(functionId string) RegistryMatcherFunc
type RegistryMock ¶
type RegistryMock struct { // FindFunc mocks the Find method. FindFunc func(ctx context.Context, matchers ...RegistryMatcherFunc) ([]RegistryItem, error) // contains filtered or unexported fields }
RegistryMock is a mock implementation of Registry.
func TestSomethingThatUsesRegistry(t *testing.T) { // make and configure a mocked Registry mockedRegistry := &RegistryMock{ FindFunc: func(ctx context.Context, matchers ...RegistryMatcherFunc) ([]RegistryItem, error) { panic("mock out the Find method") }, } // use mockedRegistry in code that requires Registry // and then make assertions. }
func (*RegistryMock) Find ¶
func (mock *RegistryMock) Find(ctx context.Context, matchers ...RegistryMatcherFunc) ([]RegistryItem, error)
Find calls FindFunc.
func (*RegistryMock) FindCalls ¶
func (mock *RegistryMock) FindCalls() []struct { Ctx context.Context Matchers []RegistryMatcherFunc }
FindCalls gets all the calls that were made to Find. Check the length with:
len(mockedRegistry.FindCalls())
Click to show internal directories.
Click to hide internal directories.