http

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatHeaderRange

func FormatHeaderRange(start, end int64) string

FormatHeaderRange generates the Range header string given start and end values

func ParseHeaderRange

func ParseHeaderRange(h string) (int64, int64, error)

ParseHeaderRange parses the Range http header. Only supports the expresion of a single range. Returns the start and end values of the range. Example: "bytes=1234-4567" would return 1234 and 4567

Types

type BasicAuthTransport

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

BasicAuthTransport is an http.RoundTripper that adds basic auth credentials to each request.

func NewBasicAuthTransport

func NewBasicAuthTransport(t http.RoundTripper, username, password string) *BasicAuthTransport

NewBasicAuthTransport sets up a transport that wraps the provided transport.

func (*BasicAuthTransport) RoundTrip

func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip adds the basic auth creds to the request and passes it along to the wrapped transport.

Directories

Path Synopsis
httpcfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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