Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Failures = SliceTransport{ { MatchAny: true, ReuseRequest: true, Status: 418, Response: `{"error_code": "NONSENSE", "message": "I'm a teapot"}`, }, }
Functions ¶
This section is empty.
Types ¶
type HTTPFixture ¶
type HTTPFixture struct { Method string Resource string MatchAny bool ReuseRequest bool Response any Status int ExpectedRequest any ExpectedHeaders map[string]string PassFile string }
HTTPFixture defines request structure for test
func (HTTPFixture) AssertHeaders ¶ added in v0.26.2
func (f HTTPFixture) AssertHeaders(req *http.Request) error
func (HTTPFixture) AssertRequest ¶
func (f HTTPFixture) AssertRequest(req *http.Request) error
func (HTTPFixture) Match ¶
func (f HTTPFixture) Match(method, resource string) bool
type MappingTransport ¶
type MappingTransport map[string]HTTPFixture
MappingTransport stubs are 2 lines shorter than SliceTransport
func (MappingTransport) SkipRetryOnIO ¶
func (fixtures MappingTransport) SkipRetryOnIO() bool
type SliceTransport ¶
type SliceTransport []HTTPFixture
func (SliceTransport) SkipRetryOnIO ¶
func (fixtures SliceTransport) SkipRetryOnIO() bool
Click to show internal directories.
Click to hide internal directories.