go: github.com/pubnub/go/tests/stubs Index | Files

package stubs

import "github.com/pubnub/go/tests/stubs"

Index

Package Files

interceptor.go roundtrip_helper_1_7.go sleeper.go

func GetRequestCancelChannel Uses

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

func NewSleeperClient Uses

func NewSleeperClient(timeout int) *http.Client

NewSleeperClient timeout - timeout in milliseconds to sleep

type Interceptor Uses

type Interceptor struct {
    Transport *interceptTransport
}

func NewInterceptor Uses

func NewInterceptor() *Interceptor

func (*Interceptor) AddStub Uses

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

func (*Interceptor) GetClient Uses

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

type Sleeper Uses

type Sleeper struct {
    Timeout int
}

Sleeper struct

func (*Sleeper) RoundTrip Uses

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

RoundTrip function helper for 1.6

type Stub Uses

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

func (*Stub) Match Uses

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

Package stubs imports 7 packages (graph). Updated 2018-06-19. Refresh now. Tools for package owners.