transport

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const (
	HeaderChecksumSha1 = "X-Checksum-Sha1"
	HeaderResultDetail = "X-Result-Detail"
	HeaderApiKey       = "X-JFrog-Art-Api"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTokenAuth

type AccessTokenAuth struct {
	AccessToken string
	Transport   http.RoundTripper
}

ApiKeyAuth exposes a HTTP Client which uses this transport. It authenticates via an Artifactory API token It also adds the correct headers to the request

func (*AccessTokenAuth) Client

func (t *AccessTokenAuth) Client() *http.Client

Client returns a HTTP Client and injects the token auth transport

func (*AccessTokenAuth) RoundTrip

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

RoundTrip allows us to add headers to every request

type ApiKeyAuth

type ApiKeyAuth struct {
	ApiKey    string
	Transport http.RoundTripper
}

ApiKeyAuth exposes a HTTP Client which uses this transport. It authenticates via an Artifactory API token It also adds the correct headers to the request

func (*ApiKeyAuth) Client

func (t *ApiKeyAuth) Client() *http.Client

Client returns a HTTP Client and injects the token auth transport

func (*ApiKeyAuth) RoundTrip

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

RoundTrip allows us to add headers to every request

type BasicAuth

type BasicAuth struct {
	Username  string
	Password  string
	Transport http.RoundTripper
}

BasicAuth allows the construction of a HTTP Client that authenticates with basic auth It also adds the correct headers to the request

func (*BasicAuth) Client

func (t *BasicAuth) Client() *http.Client

Client returns a HTTP Client and injects the basic auth transport

func (*BasicAuth) RoundTrip

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

RoundTrip allows us to add headers to every request

Jump to

Keyboard shortcuts

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