transport

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

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 CustomHeaderTransport added in v1.6.0

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

CustomHeaderTransport is a RoundTripper that adds a custom headres to all requests for example: User-Agent, and Chrono-Entity-Namespace

func (CustomHeaderTransport) RoundTrip added in v1.6.0

func (c CustomHeaderTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface.

type RuntimeConfig

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

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

Jump to

Keyboard shortcuts

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