rum

package
v0.0.0-...-bfdbfb3 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHash

func DefaultHash(r *http.Request) string

Types

type Middleware

type Middleware func(RoundTripperFunc) RoundTripperFunc

Middleware defines the RoundTripperFunc Middleware.

type MiddlewareChain

type MiddlewareChain []Middleware

MiddlewareChain defines a Middleware array.

func (MiddlewareChain) Len

func (c MiddlewareChain) Len() int

Len returns the number of middlewares in the chain.

type RequestHash

type RequestHash func(r *http.Request) string

RequestHash hashes the request for identifying a unique request.

type RoundTripperFunc

type RoundTripperFunc func(*http.Request) (*http.Response, error)

RoundTripperFunc defines the RoundTrip func used by http.RoundTripper.

func (RoundTripperFunc) RoundTrip

func (f RoundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip executes HTTP transaction.

type Transport

type Transport struct {
	http.RoundTripper
	// contains filtered or unexported fields
}

Transport implements the http.RoundTripper interface. The same as http.Transport,if is nil,will use http.DefaultTransport.

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip executes HTTP transaction with roundtriper middlewares.

func (*Transport) Use

func (t *Transport) Use(wares ...Middleware)

Use adds middleware to the t.middlewares,and wraps t.RoundTripper.

Jump to

Keyboard shortcuts

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