backend

package
v0.0.0-...-d88ec87 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSuccessful

func IsSuccessful(response *http.Response, err error) bool

IsSuccessful returns true if no networ error occured and status code < 400

Types

type Backend

type Backend struct {
	config.Storage
	http.RoundTripper
	Endpoint url.URL
	Name     string
}

Backend represents any storage in akubra cluster

func (*Backend) RoundTrip

func (b *Backend) RoundTrip(req *http.Request) (resp *http.Response, err error)

RoundTrip satisfies http.RoundTripper interface

type Response

type Response struct {
	Response *http.Response
	Request  *http.Request
	Error    error
	Backend  *Backend
}

Response helps handle responses

func (*Response) DiscardBody

func (br *Response) DiscardBody() error

DiscardBody drain and close response Body, so connections are properly closed

func (*Response) IsSuccessful

func (br *Response) IsSuccessful() bool

IsSuccessful returns true if no networ error occured and status code < 400

func (*Response) ReqID

func (br *Response) ReqID() string

ReqID returns request id

Jump to

Keyboard shortcuts

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