client

package
v0.0.0-...-31c5098 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const AUBaseURL string = "https://metrics-collector-au.cloudability.com/metricsample"
View Source
const DefaultBaseURL string = "https://metrics-collector.cloudability.com/metricsample"
View Source
const EUBaseURL string = "https://metrics-collector-eu.cloudability.com/metricsample"

Variables

This section is empty.

Functions

func GetB64MD5Hash

func GetB64MD5Hash(name string) (b64Hash string, rerr error)

GetB64MD5Hash returns base64 encoded MD5 Hash

func GetUploadURLByRegion

func GetUploadURLByRegion(region string) string

GetUploadURLByRegion returns the correct base url depending on the env variable CLOUDABILITY_UPLOAD_REGION. If value is not supported, default to us-west-2 (original) URL

Types

type Configuration

type Configuration struct {
	Timeout       time.Duration
	Token         string
	MaxRetries    int
	BaseURL       string
	ProxyURL      url.URL
	ProxyAuth     string
	ProxyInsecure bool
	Verbose       bool
	Region        string
}

Configuration represents configurable values for the Cloudability Client

type MetricClient

type MetricClient interface {
	SendMetricSample(*os.File, string, string) error
	GetUploadURL(*os.File, string, string, string, int) (string, string, error)
}

MetricClient represents a interface to send a cloudability measurement or metrics sample to an endpoint.

func NewHTTPMetricClient

func NewHTTPMetricClient(cfg Configuration) (MetricClient, error)

NewHTTPMetricClient will configure a new instance of a Cloudability client.

type MetricSampleResponse

type MetricSampleResponse struct {
	Location string `json:"location"`
}

MetricSampleResponse represents the response from the uploadmetrics endpoint

Jump to

Keyboard shortcuts

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