transport

package
v0.0.0-...-84aa726 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Password     string
	Username     string
	RequiresAuth bool
	BaseURL      *url.URL
	// contains filtered or unexported fields
}

Client act's as the entry object for sdk

func NewRestBasicAuthClient

func NewRestBasicAuthClient(opts ClientOptions) (*Client, error)

func NewRestClient

func NewRestClient(options ClientOptions) (*Client, error)

NewClient creates a new http client instance in case the provided one is nil

func (*Client) Do

func (c *Client) Do(req *retryablehttp.Request, v interface{}) (*contracts.Response, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method, endpoint string, opts interface{}) (*retryablehttp.Request, error)

func (*Client) ParseUrl

func (c *Client) ParseUrl(method, endpoint string, opts interface{}) (string, error)

func (*Client) RetryHTTPCheck

func (c *Client) RetryHTTPCheck(ctx context.Context, resp *http.Response, err error) (bool, error)

func (*Client) SetAdditionalHeaders

func (c *Client) SetAdditionalHeaders(request *retryablehttp.Request, headers http.Header)

func (*Client) SetBasicAuth

func (c *Client) SetBasicAuth(request *retryablehttp.Request) error

type ClientOptions

type ClientOptions struct {
	Hostname string
	Username string
	Password string
}

type ClientProxy

type ClientProxy interface {
	Do(req *retryablehttp.Request) (*http.Response, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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