client

package
v0.0.0-...-11f7ff2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 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 CABaseURL string = "https://metrics-collector-ca.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"
View Source
const GovBaseURL string = "https://metrics-collector-production-gov.cloudability.com/metricsample"
View Source
const INBaseURL string = "https://metrics-collector-in.cloudability.com/metricsample"
View Source
const JPBaseURL string = "https://metrics-collector-jp.cloudability.com/metricsample"
View Source
const MEBaseURL string = "https://metrics-collector-me.cloudability.com/metricsample"
View Source
const SGBaseURL string = "https://metrics-collector-sg.cloudability.com/metricsample"
View Source
const StagingBaseURL string = "https://metrics-collector-staging.cloudability.com/metricsample"

Variables

This section is empty.

Functions

func BuildProxyFunc

func BuildProxyFunc(cfg Configuration) func(*http.Request) (*url.URL, error)

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
	UseProxyForGettingUploadURLOnly 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