Documentation
¶
Overview ¶
Package runtimeapitest provides reusable fake runtime backends for dispatcher and Admin contract tests.
Index ¶
- type Backend
- func (b *Backend) Capabilities(_ context.Context, a agent.Agent) (runtimeapi.Capabilities, error)
- func (b *Backend) CapabilityCalls() []agent.Agent
- func (b *Backend) RuntimeType() string
- func (b *Backend) ServeTurn(ctx context.Context, a agent.Agent, req runtimeapi.TurnRequest, ...) error
- func (b *Backend) SetCapabilities(result runtimeapi.Capabilities, err error)
- func (b *Backend) TurnCalls() []TurnCall
- type TurnCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
Type string
CapabilitiesResult runtimeapi.Capabilities
CapabilitiesError error
ServeTurnError error
ServeTurnFunc func(context.Context, agent.Agent, runtimeapi.TurnRequest, runtimeapi.EventSink) error
// contains filtered or unexported fields
}
Backend implements only runtimeapi.Backend. Tests that need optional capabilities can embed it in a small type implementing the relevant narrow interface, so unsupported capabilities remain truthful.
func NewBackend ¶
func (*Backend) Capabilities ¶
func (b *Backend) Capabilities(_ context.Context, a agent.Agent) (runtimeapi.Capabilities, error)
func (*Backend) CapabilityCalls ¶
func (*Backend) RuntimeType ¶
func (*Backend) ServeTurn ¶
func (b *Backend) ServeTurn(ctx context.Context, a agent.Agent, req runtimeapi.TurnRequest, emit runtimeapi.EventSink) error
func (*Backend) SetCapabilities ¶
func (b *Backend) SetCapabilities(result runtimeapi.Capabilities, err error)
SetCapabilities safely replaces the fake result while contract tests are running concurrent calls.
type TurnCall ¶
type TurnCall struct {
Agent agent.Agent
Request runtimeapi.TurnRequest
}
Click to show internal directories.
Click to hide internal directories.