util

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBearerHTTPClient

func CreateBearerHTTPClient(ctx context.Context, token string) *http.Client

CreateBearerHTTPClient with given token

func Do

func Do(client *http.Client, req *http.Request, v interface{}) (*http.Response, error)

Do request for client

func GetAccessToken

func GetAccessToken(envName string) (string, error)

GetAccessToken lookup for the providers accesstoken

func IsValidResult

func IsValidResult(resp *http.Response) error

IsValidResult validates response code

func PathEscape

func PathEscape(s string) string

PathEscape to be url save

func ShouldRetry

func ShouldRetry(resp *http.Response) bool

ShouldRetry request

Types

type AddHeaderTransport

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

AddHeaderTransport struct

func NewAddHeaderTransport

func NewAddHeaderTransport(T http.RoundTripper, key, value string) *AddHeaderTransport

NewAddHeaderTransport to add default header

func (*AddHeaderTransport) RoundTrip

func (adt *AddHeaderTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip add header

Jump to

Keyboard shortcuts

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