roundtrip

package
v0.0.0-...-af4311f Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clientset

type Clientset interface {
	// DoRequest read round trip config and return response of request
	DoRequest(rt *runtime.RoundTrip) (*http.Response, error)
	// Set sets custom client with name
	// client with empty name will be default client
	Set(name string, c *http.Client)
	// Get get custom client with name
	Get(name string) (*http.Client, bool)
}

Clientset defines a clientset to do http request

func NewClientset

func NewClientset(c *http.Client) Clientset

NewClientset returns a clientset for roundtrip

type Response

type Response struct {
	Resp *http.Response
	Err  error
}

Response used for match

type ResponseHandler

type ResponseHandler interface {
	gomegatypes.GomegaMatcher

	// Variables returns variables defined in the round trip
	Variables() map[string]jsonutil.Variable
}

ResponseHandler defines handler for response It implements gomegatypes.GomegaMatcher

func MatchResponse

func MatchResponse(rt *runtime.RoundTrip) (ResponseHandler, error)

MatchResponse returns a response matcher

type ResponseMatcher

type ResponseMatcher struct {
	// contains filtered or unexported fields
}

ResponseMatcher defines a matcher to match http response

func (*ResponseMatcher) FailureMessage

func (m *ResponseMatcher) FailureMessage(actual interface{}) (message string)

FailureMessage implements gomegatypes.GomegaMatcher

func (*ResponseMatcher) Match

func (m *ResponseMatcher) Match(actual interface{}) (bool, error)

Match implements gomegatypes.GomegaMatcher

func (*ResponseMatcher) NegatedFailureMessage

func (m *ResponseMatcher) NegatedFailureMessage(actual interface{}) (message string)

NegatedFailureMessage implements gomegatypes.GomegaMatcher

func (*ResponseMatcher) Variables

func (m *ResponseMatcher) Variables() map[string]jsonutil.Variable

Variables returns variable of matcher

Jump to

Keyboard shortcuts

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