Documentation ¶
Index ¶
- Constants
- func EchoHandler() http.HandlerFunc
- func JsonHandler[T any](handler func(r *http.Request) (T, error)) http.HandlerFunc
- func NewTestRequest() *http.Request
- func NewTestRequestCloner(req *http.Request) spec.RequestCloner
- func NewTestResponse() *http.Response
- func NewTestResponseCloner(res *http.Response) spec.ResponseCloner
- func NewTestSerializableRequest() *spec.SerializableRequest
- func NewTestSerializableResponse() *spec.SerializableResponse
- func NewTestSnapshot() *spec.Snapshot
- func NewTestSnapshotRef() *spec.SnapshotRef
- type MockRoundTripper
- type MockSnapshotMessageTopic
- type MockSnapshotRouter
- type MockSnapshotStore
Constants ¶
View Source
const ( ScenarioHeader = "x-scenario-override" ScenarioDisconnect = "disconnect" ScenarioTimeout = "timeout" )
Variables ¶
This section is empty.
Functions ¶
func EchoHandler ¶
func EchoHandler() http.HandlerFunc
EchoHandler is a simple http handler that echos the request body back to the client if the x-scenario-override header is provided it will trigger a specific scenario
func JsonHandler ¶
func NewTestRequest ¶
func NewTestRequestCloner ¶
func NewTestRequestCloner(req *http.Request) spec.RequestCloner
func NewTestResponse ¶
func NewTestResponseCloner ¶
func NewTestResponseCloner(res *http.Response) spec.ResponseCloner
func NewTestSerializableRequest ¶
func NewTestSerializableRequest() *spec.SerializableRequest
func NewTestSerializableResponse ¶
func NewTestSerializableResponse() *spec.SerializableResponse
func NewTestSnapshot ¶
func NewTestSnapshotRef ¶
func NewTestSnapshotRef() *spec.SnapshotRef
Types ¶
type MockRoundTripper ¶
type MockSnapshotMessageTopic ¶
type MockSnapshotRouter ¶
func (*MockSnapshotRouter) Match ¶
func (m *MockSnapshotRouter) Match(req *http.Request) (ref *spec.SnapshotRef, er error)
func (*MockSnapshotRouter) Register ¶
func (m *MockSnapshotRouter) Register(ref *spec.SnapshotRef, rules ...spec.MatchRule) spec.SnapshotRouter
type MockSnapshotStore ¶
func (*MockSnapshotStore) Read ¶
func (m *MockSnapshotStore) Read(ref *spec.SnapshotRef) (snapshot *spec.Snapshot, err error)
func (*MockSnapshotStore) Write ¶
func (m *MockSnapshotStore) Write(snapshot *spec.Snapshot) (ref *spec.SnapshotRef, err error)
Click to show internal directories.
Click to hide internal directories.