registry

package
v1.22.0-capdev.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 5 Imported by: 7 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func GetRegistry(tb testing.TB) *Registry

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.

Jump to

Keyboard shortcuts

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