Documentation
¶
Overview ¶
Package modeltest provides a scripted model for tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrExhausted = errors.New("modeltest: script exhausted")
ErrExhausted is returned when the script has no more steps.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model replays a fixed script of steps and records every request.
func (*Model) Stream ¶
func (m *Model) Stream(ctx context.Context, req *model.Request) iter.Seq2[*model.StreamEvent, error]
Stream streams the next scripted response. Text parts are split into several deltas so callers see incremental output. A step that returns no response and no error makes the stream fail.
Click to show internal directories.
Click to hide internal directories.