transport

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package transport provides methods to create an HTTP transport that can communicate with the Chronosphere API.

Index

Constants

View Source
const (

	// OrgNameEnvVar is the name of the environment variable that can be used to set the
	// Chronosphere organization name.
	OrgNameEnvVar = "CHRONOSPHERE_ORG_NAME"
)

Variables

This section is empty.

Functions

func New

func New(config RuntimeConfig) (*httptransport.Runtime, error)

New creates a new HTTP transport that can communicate with the Chronosphere API.

Types

type Component

type Component string

Component is a value that indicates the part of the CLI that is invoking an API. This is used to set the User-Agent header when making requests to the Chronosphere API.

var (
	// ComponentChronoctl is the value for the stable chronoctl component
	ComponentChronoctl Component = "chrono-ctl"
	// ComponentChronoctlUnstable is the value for the unstable chronoctl component
	ComponentChronoctlUnstable Component = "unstable-chrono-ctl"
)

type RuntimeConfig

type RuntimeConfig struct {
	Component          Component
	OrgName            string
	APIToken           string
	APIUrl             string
	InsecureSkipVerify bool
	AllowHTTP          bool
	DefaultBasePath    string
}

RuntimeConfig is a struct that contains the configuration for creating a new HTTP transport

type VersionHeaderTransport

type VersionHeaderTransport struct {
	Rt http.RoundTripper
	// contains filtered or unexported fields
}

VersionHeaderTransport is a RoundTripper that adds a User-Agent header to all requests.

func (VersionHeaderTransport) RoundTrip

func (v VersionHeaderTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface.

Jump to

Keyboard shortcuts

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