client

package
v0.0.0-...-270f78c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Zlib Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecutePingOperation

func ExecutePingOperation(host string, tlsConfig *tls.Config) (bool, error)

ExecutePingOperation will send a SystemPing operation HTTP request to a Docker environment(endpoint) using the specified host and optional TLS configuration. It uses a new Http.Client for each operation.

func Get

func Get(url string, timeout int) ([]byte, error)

Get executes a simple HTTP GET to the specified URL and returns the content of the response body. Timeout can be specified via the timeout parameter, will default to defaultHTTPTimeout if set to 0.

Types

type AzureAuthenticationResponse

type AzureAuthenticationResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresOn   string `json:"expires_on"`
}

AzureAuthenticationResponse represents an Azure API authentication response.

type HTTPClient

type HTTPClient struct {
	*http.Client
}

HTTPClient represents a client to send HTTP requests.

func NewHTTPClient

func NewHTTPClient() *HTTPClient

NewHTTPClient is used to build a new HTTPClient.

func (*HTTPClient) ExecuteAzureAuthenticationRequest

func (client *HTTPClient) ExecuteAzureAuthenticationRequest(credentials *portainer.AzureCredentials) (*AzureAuthenticationResponse, error)

ExecuteAzureAuthenticationRequest is used to execute an authentication request against the Azure API. It re-uses the same http.Client.

Jump to

Keyboard shortcuts

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