Documentation
¶
Overview ¶
Package recorder provides call recording (VCR pattern) for cloudemu services.
Index ¶
- type Call
- type Matcher
- func (m *Matcher) AllErrored() *Matcher
- func (m *Matcher) Count(expected int) *Matcher
- func (m *Matcher) ForOperation(op string) *Matcher
- func (m *Matcher) ForService(service string) *Matcher
- func (m *Matcher) HasCalls() *Matcher
- func (m *Matcher) NoCalls() *Matcher
- func (m *Matcher) NoErrors() *Matcher
- func (m *Matcher) String() string
- type Recorder
- func (r *Recorder) CallCount() int
- func (r *Recorder) CallCountFor(service, operation string) int
- func (r *Recorder) Calls() []Call
- func (r *Recorder) CallsFor(service, operation string) []Call
- func (r *Recorder) LastCall() *Call
- func (r *Recorder) Record(service, operation string, input, output any, err error, ...)
- func (r *Recorder) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct {
Service string
Operation string
Input any
Output any
Error error
Timestamp time.Time
Duration time.Duration
}
Call represents a recorded API call.
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher provides fluent test assertions for recorded calls.
func NewMatcher ¶
NewMatcher creates a Matcher from a recorder.
func (*Matcher) AllErrored ¶
AllErrored asserts that all calls had errors.
func (*Matcher) ForOperation ¶
ForOperation filters calls by operation.
func (*Matcher) ForService ¶
ForService filters calls by service.
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder records API calls for later assertion.
func (*Recorder) CallCountFor ¶
CallCountFor returns the number of calls matching the given service and operation.
Click to show internal directories.
Click to hide internal directories.