Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type Option
- func WithAgent(agent string) Option
- func WithApiPort(port int) 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 WithSkipPreRequestValidation(skip bool) Option
- func WithSkipVerifyCertificate(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_PORT_ENV_VAR = "CORTEXCLOUD_API_PORT" CORTEXCLOUD_API_KEY_ENV_VAR = "CORTEXCLOUD_API_KEY" CORTEXCLOUD_API_KEY_ID_ENV_VAR = "CORTEXCLOUD_API_KEY_ID" CORTEXCLOUD_HEADERS_ENV_VAR = "CORTEXCLOUD_HEADERS" CORTEXCLOUD_AGENT_ENV_VAR = "CORTEXCLOUD_AGENT" CORTEXCLOUD_SKIP_VERIFY_CERTIFICATE_ENV_VAR = "CORTEXCLOUD_SKIP_VERIFY_CERTIFICATE" 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" CORTEXCLOUD_SKIP_PRE_REQUEST_VALIDATION = "CORTEXCLOUD_SKIP_PRE_REQUEST_VALIDATION" )
Variables ¶
var ( GitCommit = "NOCOMMIT" GoVersion = runtime.Version() BuildDate = "" )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ApiUrl string `json:"api_url" validate:"required,url"`
ApiKey string `json:"api_key" validate:"required,base64"`
ApiKeyId int `json:"api_key_id" validate:"required,gte=1"`
ApiPort int `json:"api_port" validate:"gte=1,lte=65535"`
Headers map[string]string `json:"headers"`
Agent string `json:"agent"`
SkipVerifyCertificate bool `json:"skip_verify_certificate"`
Transport *http.Transport `json:"-"`
Timeout int `json:"timeout"`
MaxRetries int `json:"max_retries"`
RetryMaxDelay int `json:"retry_max_delay"`
CrashStackDir string `json:"crash_stack_dir"`
LogLevel string `json:"log_level"`
Logger _log.Logger `json:"-"`
SkipLoggingTransport bool `json:"skip_logging_transport"`
SkipPreRequestValidation bool `json:"skip_pre_request_validation"`
}
func NewConfigFromFile ¶
type Option ¶
type Option func(*Config)
func WithApiPort ¶
WithApiPort returns an Option that sets the ApiPort 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 WithSkipPreRequestValidation ¶
WithSkipPreRequestValidation returns an Option that sets the SkipPreRequestValidation field.
func WithSkipVerifyCertificate ¶
WithSkipVerifyCertificate returns an Option that sets the SkipVerifyCertificate 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.