...

Package internal

import "github.com/jarcoal/httpmock/internal"
Overview
Index

Overview ▾

Variables

NoResponderFound is returned when no responders are found for a given HTTP method and URL.

var NoResponderFound = errors.New("no responder found") // nolint: revive

func CheckStackTracer

func CheckStackTracer(req *http.Request, err error) error

CheckStackTracer checks for specific error returned by NewNotFoundResponder function or Trace Responder method.

func GetSubmatches

func GetSubmatches(req *http.Request) []string

func SetSubmatches

func SetSubmatches(req *http.Request, submatches []string) *http.Request

type ErrorNoResponderFoundMistake

ErrorNoResponderFoundMistake encapsulates a NoResponderFound error probably due to a user error on the method or URL path.

type ErrorNoResponderFoundMistake struct {
    Kind      string // "method" or "URL"
    Orig      string // original wrong method/URL, without any matching responder
    Suggested string // suggested method/URL with a matching responder
}

func (*ErrorNoResponderFoundMistake) Error

func (e *ErrorNoResponderFoundMistake) Error() string

Error implements error interface.

func (*ErrorNoResponderFoundMistake) Unwrap

func (e *ErrorNoResponderFoundMistake) Unwrap() error

Unwrap implements the interface needed by errors.Unwrap.

type RouteKey

type RouteKey struct {
    Method string
    URL    string
}
var NoResponder RouteKey

func (RouteKey) String

func (r RouteKey) String() string

type StackTracer

type StackTracer struct {
    CustomFn func(...interface{})
    Err      error
}

func (StackTracer) Error

func (s StackTracer) Error() string

Error implements error interface.

func (StackTracer) Unwrap

func (s StackTracer) Unwrap() error

Unwrap implements the interface needed by errors.Unwrap.