client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient(ctx context.Context, authService Provider) (*http.Client, error)

NewHTTPClient returns a new http transport based on the auth service.

Types

type BasicTransport

type BasicTransport struct {
	Username string `cfg:"username"`
	Password string `cfg:"password"`
	// contains filtered or unexported fields
}

Oauth2Transport wraps oauth2.Transport to suspend CancelRequest.

func (BasicTransport) BasicRoundTripper

func (t BasicTransport) BasicRoundTripper(_ context.Context, transport http.RoundTripper) (http.RoundTripper, error)

BasicRoundTripper returns a new RoundTripper that adds a basic auth header to the request.

If Source is nil, returns transport as-is.

func (*BasicTransport) RoundTrip

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

type Provider

type Provider struct {
	auth.Provider `cfg:",squash"`

	BasicAuth BasicTransport `cfg:"basic"`
}

Jump to

Keyboard shortcuts

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