transport

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transport

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

Transport implements the http.RoundTripper interface for use by Staking HTTP clients.

func NewTransport

func NewTransport(
	roundTripper http.RoundTripper,
	serviceName string,
	apiKey *auth.APIKey,
) *Transport

NewTransport returns new transport based on the given inputs.

func (*Transport) RoundTrip

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

RoundTrip implements the http.RoundTripper interface and wraps the base round tripper with logic to inject the API key auth-based HTTP headers into the request. Reference: https://pkg.go.dev/net/http#RoundTripper

Jump to

Keyboard shortcuts

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