Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capability ¶
type Capability interface {
Invoke(ctx context.Context, request *sdk.CapabilityRequest) *sdk.CapabilityResponse
ID() string
}
Capability is meant to be implemented by generated code for capability mocks.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is meant to be used with GetRegistry, do not use it directly.
func GetRegistry ¶
GetRegistry returns a Registry instance scoped to the provided testing.TB, creating one if it doesn't exist. The registry is used internally by the test utilities to manage mock capabilities.
func (*Registry) ForceRegisterCapability ¶
func (r *Registry) ForceRegisterCapability(c Capability)
ForceRegisterCapability is like RegisterCapability but it overwrites any existing capability with the same ID.
func (*Registry) GetCapability ¶
func (r *Registry) GetCapability(id string) (Capability, error)
GetCapability is meant to be used by generated code to retrieve a registered capability. It retrieves a registered capability by its ID. It returns an error if no capability with the given ID is found.
func (*Registry) RegisterCapability ¶
func (r *Registry) RegisterCapability(c Capability) error
RegisterCapability is meant to be called by generated mock code to register the mock with the test. It returns an error if a capability with the same ID is already registered.