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
- type Clients
- type Flags
- func (f *Flags) AddFlags(cmd *cobra.Command)
- func (f *Flags) ConfigUnstableClient() (config_unstable.ClientService, error)
- func (f *Flags) ConfigV1Client() (config_v1.ClientService, error)
- func (f *Flags) StateUnstableClient() (state_unstable.ClientService, error)
- func (f *Flags) StateV1Client() (state_v1.ClientService, error)
- func (f *Flags) Timeout() time.Duration
- func (f *Flags) Transport(component transport.Component, basePath string) (*httptransport.Runtime, error)
Constants ¶
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" )
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 TokenStoreDir string // dev flag }
Flags composes common flags used to configure the Chronosphere API client.
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.