http

package
v0.0.0-...-be214e9 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedResponse

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

CachedResponse implements the Response interface, providing the ability to cache the critical pieces of information from a response object

func NewCachedResponseFromHTTP

func NewCachedResponseFromHTTP(r *http.Response) (*CachedResponse, error)

NewCachedResponseFromHTTP is a creator for a cached response object that accepts a HTTP response as input

func (*CachedResponse) Body

func (r *CachedResponse) Body() []byte

Body returns the cached body of a HTTP response

func (*CachedResponse) Header

func (r *CachedResponse) Header() http.Header

Header returns the cached header of a HTTP response

type Response

type Response interface {
	Body() []byte
	Header() http.Header
}

Response is an interface for a HTTP response-like structure that has cached data

func NewCachedResponse

func NewCachedResponse(body []byte, header http.Header) Response

NewCachedResponse is a constructor method that creates a cached response object from provided response payload and header

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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