config

package
v0.0.0-...-1ca99b1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ApiClientIdKey = "client-id"
View Source
const ApiClientSecretKey = "client-secret"
View Source
const ApiCredentialsFilename = "credentials"
View Source
const ApiSelectedOrganizationId = "org-id"
View Source
const ApiUserTokenExpiryKey = "token-expiry"
View Source
const ApiUserTokenKey = "token"
View Source
const ContextIdKey = "context-id"
View Source
const DebugDefault = false
View Source
const DebugKey = "debug"
View Source
const DefaultTimeout = 60 * time.Second
View Source
const EnvPrefix = "OTTERIZE"
View Source
const NoHeadersDefault = false
View Source
const NoHeadersKey = "no-headers"
View Source
const OtterizeAPIAddressDefault = "https://app.otterize.com/api"
View Source
const OtterizeAPIAddressKey = "api-address"
View Source
const OtterizeConfigDirName = ".otterize"
View Source
const OtterizeConfigFileName = "config"
View Source
const OtterizeContextIdFileName = "contextId"
View Source
const OutputFormatDefault = OutputFormatText
View Source
const OutputFormatJSON = "json"
View Source
const OutputFormatKey = "format"
View Source
const OutputFormatText = "text"
View Source
const OutputFormatYAML = "yaml"
View Source
const QuietModeDefault = false
View Source
const QuietModeKey = "quiet"
View Source
const QuietModeShorthand = "q"
View Source
const TelemetryEnabledDefault = true
View Source
const TelemetryEnabledKey = "telemetry-enabled"
View Source
const TelemetryErrorEnabledDefault = true
View Source
const TelemetryErrorsAddressDefault = "https://app.otterize.com/api/errors"
View Source
const TelemetryErrorsAddressKey = "telemetry-errors-address"
View Source
const TelemetryErrorsEnabledKey = "telemetry-errors-enabled"
View Source
const TelemetryErrorsStageDefault = "production"
View Source
const TelemetryErrorsStageKey = "telemetry-errors-stage"
View Source
const TelemetryUsageEnabledDefault = true
View Source
const TelemetryUsageEnabledKey = "telemetry-usage-enabled"

Variables

View Source
var CfgFile string // used for flag

Functions

func BindPFlags

func BindPFlags(cmd *cobra.Command, _ []string)

func InitConfig

func InitConfig()

func InitContextId

func InitContextId()

func LoadApiCredentialsFile

func LoadApiCredentialsFile()

func LoadConfigFile

func LoadConfigFile(output any, filename string) (bool, error)

func OtterizeConfigDirPath

func OtterizeConfigDirPath() (string, error)

func RegisterStringArg

func RegisterStringArg(cmd *cobra.Command, configKey string, usage string, required bool)

func RegisterStringArgShorthand

func RegisterStringArgShorthand(cmd *cobra.Command, configKey string, usage string, required bool, shorthand string)

func RegisterStringArgShorthandWithDefault

func RegisterStringArgShorthandWithDefault(cmd *cobra.Command, configKey string, usage string, required bool, defaultValue string, shorthand string)

func RegisterStringArgWithDefault

func RegisterStringArgWithDefault(cmd *cobra.Command, configKey string, usage string, required bool, defaultValue string)

func SaveConfig

func SaveConfig(conf Config) error

func SaveJSONConfig

func SaveJSONConfig(config any, filename string) error

Types

type Config

type Config struct {
	ClientId       string    `json:"client_id,omitempty"`
	ClientSecret   string    `json:"client_secret,omitempty"`
	UserToken      string    `json:"user_token,omitempty"`
	Expiry         time.Time `json:"expiry,omitempty"`
	OrganizationId string    `json:"organization_id"`
}

Jump to

Keyboard shortcuts

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