stubs

package
v4.10.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequestCancelChannel

func GetRequestCancelChannel(req *http.Request) <-chan error

func NewSleeperClient

func NewSleeperClient(timeout int) *http.Client

NewSleeperClient timeout - timeout in milliseconds to sleep

Types

type Interceptor

type Interceptor struct {
	Transport *interceptTransport
}

func NewInterceptor

func NewInterceptor() *Interceptor

func (*Interceptor) AddStub

func (i *Interceptor) AddStub(stub *Stub)

func (*Interceptor) GetClient

func (i *Interceptor) GetClient() *http.Client

type Sleeper

type Sleeper struct {
	Timeout int
}

Sleeper struct

func (*Sleeper) RoundTrip

func (s *Sleeper) RoundTrip(req *http.Request) (*http.Response,
	error)

RoundTrip function helper for 1.6

type Stub

type Stub struct {
	Method             string
	Path               string
	Query              string
	ResponseBody       string
	ResponseStatusCode int
	MixedPathPositions []int
	IgnoreQueryKeys    []string
	MixedQueryKeys     []string
	Hang               bool
}

func (*Stub) Match

func (s *Stub) Match(req *http.Request) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL