Documentation
¶
Overview ¶
Package config handles client configuration.
Index ¶
- Constants
- type Config
- func (c *Config) Agent() string
- func (c *Config) CortexAPIKey() string
- func (c *Config) CortexAPIKeyID() int
- func (c *Config) CortexAPIKeyType() string
- func (c *Config) CortexAPIURL() string
- func (c *Config) CrashStackDir() string
- func (c *Config) GetOptions() []Option
- func (c *Config) Headers() map[string]string
- func (c *Config) LogLevel() string
- func (c *Config) Logger() cortexLog.Logger
- func (c *Config) MaxRetries() int
- func (c *Config) RetryMaxDelay() int
- func (c *Config) SetDefaults()
- func (c *Config) SkipLoggingTransport() bool
- func (c *Config) SkipSSLVerify() bool
- func (c *Config) Timeout() int
- func (c *Config) Transport() *http.Transport
- func (c *Config) UnmarshalJSON(data []byte) error
- func (c Config) Validate() error
- type Option
- func WithAgent(agent string) Option
- func WithCortexAPIKey(apiKey string) Option
- func WithCortexAPIKeyID(apiKeyID int) Option
- func WithCortexAPIKeyType(keyType string) Option
- func WithCortexAPIURL(apiURL string) Option
- func WithCrashStackDir(dir string) Option
- func WithHeaders(headers map[string]string) Option
- func WithLogLevel(level string) Option
- func WithLogger(l sdkLog.Logger) Option
- func WithMaxRetries(retries int) Option
- func WithRetryMaxDelay(delay int) Option
- func WithSkipLoggingTransport(skip bool) Option
- func WithSkipSSLVerify(skip bool) Option
- func WithTimeout(timeout int) Option
- func WithTransport(transport *http.Transport) Option
Constants ¶
const ( CORTEXCLOUD_API_URL_ENV_VAR = "CORTEXCLOUD_API_URL" CORTEXCLOUD_API_KEY_ENV_VAR = "CORTEXCLOUD_API_KEY" CORTEXCLOUD_API_KEY_ID_ENV_VAR = "CORTEXCLOUD_API_KEY_ID" CORTEXCLOUD_API_KEY_TYPE_ENV_VAR = "CORTEXCLOUD_API_KEY_TYPE" CORTEXCLOUD_HEADERS_ENV_VAR = "CORTEXCLOUD_HEADERS" CORTEXCLOUD_AGENT_ENV_VAR = "CORTEXCLOUD_AGENT" CORTEXCLOUD_SKIP_SSL_VERIFY_ENV_VAR = "CORTEXCLOUD_SKIP_SSL_VERIFY" CORTEXCLOUD_CONFIG_FILE_ENV_VAR = "CORTEXCLOUD_CONFIG_FILE" CORTEXCLOUD_TIMEOUT_ENV_VAR = "CORTEXCLOUD_TIMEOUT" CORTEXCLOUD_MAX_RETRIES_ENV_VAR = "CORTEXCLOUD_MAX_RETRIES" CORTEXCLOUD_RETRY_MAX_DELAY_ENV_VAR = "CORTEXCLOUD_RETRY_MAX_DELAY" CORTEXCLOUD_CRASH_STACK_DIR_ENV_VAR = "CORTEXCLOUD_CRASH_STACK_DIR" CORTEXCLOUD_LOG_LEVEL_ENV_VAR = "CORTEXCLOUD_LOG_LEVEL" CORTEXCLOUD_SKIP_LOGGING_TRANSPORT_ENV_VAR = "CORTEXCLOUD_SKIP_LOGGING_TRANSPORT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfigFromFile ¶
func (*Config) CortexAPIKey ¶
CortexAPIKey returns the Cortex API key.
func (*Config) CortexAPIKeyID ¶
CortexAPIKeyID returns the Cortex API key ID.
func (*Config) CortexAPIKeyType ¶
CortexAPIKeyType returns the Cortex API key type.
func (*Config) CortexAPIURL ¶
CortexAPIURL returns the API URL for the Cortex.
func (*Config) CrashStackDir ¶
CrashStackDir returns the crash stack directory.
func (*Config) GetOptions ¶
func (*Config) MaxRetries ¶
MaxRetries returns the maximum number of retries.
func (*Config) RetryMaxDelay ¶
RetryMaxDelay returns the maximum retry delay.
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
SetDefaults sets default values for the configuration.
func (*Config) SkipLoggingTransport ¶
SkipLoggingTransport returns whether to skip logging transport.
func (*Config) SkipSSLVerify ¶
SkipSSLVerify returns whether to skip TLS certificate verification.
func (*Config) UnmarshalJSON ¶ added in v1.0.4
UnmarshalJSON unmarshals the provided byte array into the calling Config struct.
type Option ¶
type Option func(*Config)
func WithCortexAPIKey ¶
WithCortexAPIKey returns an Option that sets the CortexAPIKey field.
func WithCortexAPIKeyID ¶
WithCortexAPIKeyID returns an Option that sets the CortexAPIKeyID field.
func WithCortexAPIKeyType ¶
WithCortexAPIKeyType returns an Option that sets the CortexAPIKeyType field.
func WithCortexAPIURL ¶
WithCortexAPIURL returns an Option that sets the CortexAPIURL field.
func WithCrashStackDir ¶
WithCrashStackDir returns an Option that sets the CrashStackDir field.
func WithHeaders ¶
WithHeaders returns an Option that sets or adds to the Headers map.
func WithLogLevel ¶
WithLogLevel returns an Option that sets the LogLevel field.
func WithLogger ¶
WithLogger returns an Option that sets the Logger field.
func WithMaxRetries ¶
WithMaxRetries returns an Option that sets the MaxRetries field.
func WithRetryMaxDelay ¶
WithRetryMaxDelay returns an Option that sets the RetryMaxDelay field (in seconds).
func WithSkipLoggingTransport ¶
WithSkipLoggingTransport returns an Option that sets the SkipLoggingTransport field.
func WithSkipSSLVerify ¶
WithSkipSSLVerify returns an Option that sets the SkipSSLVerify field.
func WithTimeout ¶
WithTimeout returns an Option that sets the Timeout field (in seconds).
func WithTransport ¶
WithTransport returns an Option that sets the Transport field.