client

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: 13 Imported by: 0

Documentation

Overview

Package client implements client flags for chronoctl CLI commands and gives commands access to client objects that can be used to make API calls.

Index

Constants

View Source
const (
	// TestChronosphereURL is the URL of the Chronosphere API used for testing.
	TestChronosphereURL = "https://myorg.chronosphere.io/api"
	// TestBadURL is a bad URL used for testing.
	TestBadURL = "://bad.domain.io"

	// ChronosphereOrgNameKey is the environment variable that specifies the Chronosphere customer organization
	ChronosphereOrgNameKey = "CHRONOSPHERE_ORG_NAME"
	// ChronosphereOrgKey is the environment variable that specifies the Chronosphere customer organization
	ChronosphereOrgKey = "CHRONOSPHERE_ORG" // fallback for CHRONOSPHERE_ORG_NAME
	// ChronosphereAPITokenKey is the environment variable that specifies the Chronosphere API token
	ChronosphereAPITokenKey = "CHRONOSPHERE_API_TOKEN"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Clients

type Clients struct {
	ConfigV1       config_v1.ClientService
	ConfigUnstable config_unstable.ClientService
}

Clients is a list of clients our generated CLI needs access to.

type Flags

type Flags struct {
	APIToken           string
	APITokenFilename   string
	OrgName            string
	TimeoutSeconds     int
	APIUrl             string // dev flag
	AllowHTTP          bool   // dev flag
	InsecureSkipVerify bool   // dev flag
}

Flags composes common flags used to configure the Chronosphere API client.

func NewClientFlags

func NewClientFlags() *Flags

NewClientFlags returns a new Flags object.

func (*Flags) AddFlags

func (f *Flags) AddFlags(cmd *cobra.Command)

AddFlags adds client flags to a Cobra command.

func (*Flags) ConfigUnstableClient

func (f *Flags) ConfigUnstableClient() (config_unstable.ClientService, error)

ConfigUnstableClient creates a new client to hit config/unstable APIs. This client should only be used in hidden commands as these APIs are subject to change.

func (*Flags) ConfigV1Client

func (f *Flags) ConfigV1Client() (config_v1.ClientService, error)

ConfigV1Client creates a new client to hit configv1 APIs.

func (*Flags) StateUnstableClient

func (f *Flags) StateUnstableClient() (state_unstable.ClientService, error)

StateUnstableClient creates a new client to hit state/unstable APIs. This client should only be used in hidden commands as these APIs are subject to change.

func (*Flags) StateV1Client

func (f *Flags) StateV1Client() (state_v1.ClientService, error)

StateV1Client creates a new client to hit statev1 APIs.

func (*Flags) Timeout

func (f *Flags) Timeout() time.Duration

Timeout returns the value of the timeout flag as a time.Duration.

func (*Flags) Transport

func (f *Flags) Transport(component transport.Component, basePath string) (*httptransport.Runtime, error)

Transport returns a new transport for the given api base path.

Jump to

Keyboard shortcuts

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