Versions in this module Expand all Collapse all v1 v1.1.0 Jul 24, 2022 v1.0.0 Jul 22, 2022 Changes in this version + type Expectation struct + Matcher expect.Matcher + Target string + ValueSelector expect.ValueSelector + Weight Weight + type FindResult struct + ClosestMatch *Mock + Matched *Mock + Matches bool + MismatchDetails []MismatchDetail + func FindMockForRequest(storage Storage, params expect.Args) (*FindResult, error) + type MatchResult struct + IsMatch bool + MismatchDetails []MismatchDetail + Weight int + type MismatchDetail struct + Description string + Name string + Target string + type Mock struct + Enabled bool + Expectations []Expectation + Hits int + ID int + Name string + PostActions []PostAction + PostExpectations []Expectation + Priority int + Reply Reply + func NewMock() *Mock + func (m *Mock) Called() bool + func (m *Mock) Dec() + func (m *Mock) Disable() + func (m *Mock) Enable() + func (m *Mock) Hit() + func (m *Mock) Matches(params expect.Args, expectations []Expectation) (MatchResult, error) + type PostAction interface + Run func(args PostActionArgs) error + type PostActionArgs struct + Mock *Mock + Params parameters.Params + Request *http.Request + Response *Response + type Reply interface + Build func(*http.Request, *Mock, parameters.Params) (*Response, error) + type Response struct + Body io.Reader + Cookies []*http.Cookie + Delay time.Duration + Header http.Header + Mappers []ResponseMapper + Status int + type ResponseMapper func(res *Response, args ResponseMapperArgs) error + type ResponseMapperArgs struct + Parameters parameters.Params + Request *http.Request + type Storage interface + Delete func(id int) + FetchAll func() []*Mock + FetchEligible func() []*Mock + Flush func() + Save func(mock *Mock) + func NewStorage() Storage + type T interface + Errorf func(string, ...any) + FailNow func() + Helper func() + Logf func(string, ...any) + type Weight int + const WeightHigh + const WeightLow + const WeightNone + const WeightRegular + const WeightVeryLow