common

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractHttpError

func ExtractHttpError(resp *http.Response) error

func FilterStrSlice

func FilterStrSlice(elem string, s []string) []string

func HumanDuration

func HumanDuration(from, to time.Time) string

func InStrSlice

func InStrSlice(elem string, s []string) bool

func MakeHttpTransport

func MakeHttpTransport(skipInsecure bool) http.RoundTripper

func MakeHttpTransportWithHeader

func MakeHttpTransportWithHeader(skipInsecure bool, key, val string) http.RoundTripper

func Title

func Title(content string) string

Types

type HeaderTransport

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

func NewHeaderTransport

func NewHeaderTransport(transport http.RoundTripper, key, val string) *HeaderTransport

func (HeaderTransport) RoundTrip

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

Jump to

Keyboard shortcuts

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