client

package
v0.0.0-...-bc5bf8d Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBackoffDelayFactor float64 = 3
View Source
const DefaultBackoffMaxDelay int = 60
View Source
const DefaultBackoffMinDelay int = 4
View Source
const DefaultReqTimeoutVal int = 100

Default timeout for NGINX in ND is 90 Seconds. Allow the client to set a shorter or longer time depending on their environment

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Token  string
	Expiry time.Time
}

func (*Auth) CalculateExpiry

func (t *Auth) CalculateExpiry(willExpire int64)

func (*Auth) IsValid

func (au *Auth) IsValid() bool

type Client

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

Client is the main entry point

func GetClient

func GetClient(clientUrl, username, password, proxyUrl, proxyCreds, loginDomain string, isInsecure bool, maxRetries int64) *Client

GetClient returns a singleton

func (*Client) Authenticate

func (c *Client) Authenticate() error

func (*Client) Do

func (c *Client) Do(req *http.Request, skipLoggingPayload bool) (*gabs.Container, *http.Response, error)

func (*Client) DoRestRequest

func (c *Client) DoRestRequest(ctx context.Context, diags *diag.Diagnostics, path, method string, payload *gabs.Container) *gabs.Container

func (c *Client) DoRestRequest(ctx context.Context, diags *diag.Diagnostics, client *Client, path, method string, payload *gabs.Container) *gabs.Container {

func (*Client) InjectAuthenticationHeader

func (client *Client) InjectAuthenticationHeader(req *http.Request, path string) (*http.Request, error)

func (*Client) MakeRestRequest

func (c *Client) MakeRestRequest(method string, path string, body *gabs.Container, authenticated bool, skipLoggingPayload bool) (*http.Request, error)

Jump to

Keyboard shortcuts

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