constants

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: AGPL-3.0 Imports: 7 Imported by: 23

README

This is to specific to Steampipe - need to rethink its approach if we want to share this with Flowpipe

Documentation

Index

Constants

View Source
const (
	ArgArg                     = "arg"
	ArgAutoComplete            = "auto-complete"
	ArgCacheMaxTtl             = "cache-max-ttl"
	ArgCacheTtl                = "cache-ttl"
	ArgClientCacheEnabled      = "client-cache-enabled"
	ArgDashboardStartTimeout   = "dashboard-start-timeout"
	ArgDatabaseListenAddresses = "database-listen"
	ArgDatabasePort            = "database-port"
	ArgDatabaseQueryTimeout    = "query-timeout"
	ArgDatabaseStartTimeout    = "database-start-timeout"
	ArgDetach                  = "detach"
	ArgDisplayWidth            = "display-width"
	ArgDryRun                  = "dry-run"
	ArgEnvironment             = "environment"
	ArgExport                  = "export"
	ArgForce                   = "force"
	ArgHeader                  = "header"
	ArgHelp                    = "help"
	ArgHost                    = "host"
	ArgInput                   = "input"
	ArgInsecure                = "insecure"
	ArgInstallDir              = "install-dir"
	ArgIntrospection           = "introspection"
	ArgListen                  = "listen"
	ArgLogLevel                = "log-level"
	ArgMaxCacheSizeMb          = "max-cache-size-mb"
	ArgMaxParallel             = "max-parallel"
	ArgMemoryMaxMb             = "memory-max-mb"
	ArgMemoryMaxMbPlugin       = "memory-max-mb-plugin"
	ArgModInstall              = "mod-install"
	ArgModLocation             = "mod-location"
	ArgMultiLine               = "multi-line"
	ArgOff                     = "off"
	ArgOn                      = "on"
	ArgOutput                  = "output"
	ArgPipesInstallDir         = "pipes-install-dir"
	ArgPipesHost               = "pipes-host"
	ArgPipesToken              = "pipes-token"
	ArgPort                    = "port"
	ArgProgress                = "progress"
	ArgPrune                   = "prune"
	ArgSearchPath              = "search-path"
	ArgSearchPathPrefix        = "search-path-prefix"
	ArgSeparator               = "separator"
	ArgServiceCacheEnabled     = "service-cache-enabled"
	ArgShare                   = "share"
	ArgSnapshot                = "snapshot"
	ArgSnapshotLocation        = "snapshot-location"
	ArgSnapshotTag             = "snapshot-tag"
	ArgSnapshotTitle           = "snapshot-title"
	ArgTag                     = "tag"
	ArgTelemetry               = "telemetry"
	ArgTiming                  = "timing"
	ArgUpdateCheck             = "update-check"
	ArgVarFile                 = "var-file"
	ArgVariable                = "var"
	ArgVerbose                 = "verbose"
	ArgWatch                   = "watch"
	ArgWhere                   = "where"
	ArgDatabase                = "database"
	ArgWorkspaceProfile        = "workspace"
	ArgConfigPath              = "config-path"
	ArgBaseUrl                 = "base-url"

	// Flowpipe concurrency
	ArgMaxConcurrencyHttp      = "max-concurrency-http"
	ArgMaxConcurrencyQuery     = "max-concurrency-query"
	ArgMaxConcurrencyContainer = "max-concurrency-container"
	ArgMaxConcurrencyFunction  = "max-concurrency-function"
	ArgProcessRetention        = "process-retention"
)

Argument name constants

View Source
const (
	DuckDBBackendName    = "DuckDB"
	MySQLBackendName     = "MySQL"
	PostgresBackendName  = "PostgreSQL"
	SQLiteBackendName    = "SQLite"
	SteampipeBackendName = "Steampipe"
)
View Source
const (
	DefaultPipesHost       = "pipes.turbot.com"
	LegacyDefaultPipesHost = "cloud.steampipe.io"
)
View Source
const (
	CmdNameQuery     = "query"
	CmdNameCheck     = "check"
	CmdNameDashboard = "dashboard"
)
View Source
const (
	ConfigKeyInteractive                 = "interactive"
	ConfigKeyActiveCommand               = "cmd"
	ConfigKeyActiveCommandArgs           = "cmd_args"
	ConfigInteractiveVariables           = "interactive_var"
	ConfigKeyIsTerminalTTY               = "is_terminal"
	ConfigKeyServerSearchPath            = "server-search-path"
	ConfigKeyServerSearchPathPrefix      = "server-search-path-prefix"
	ConfigKeyBypassHomeDirModfileWarning = "bypass-home-dir-modfile-warning" //nolint: gosec // not credentials
)

viper config keys

View Source
const (
	// ControlQueryCancellationTimeoutSecs is maximum number of seconds to wait for control queries to finish cancelling
	ControlQueryCancellationTimeoutSecs = 30
	// MaxControlRunAttempts determines how many time should a cotnrol run should be retried
	// in the case of a GRPC connectivity error
	MaxControlRunAttempts = 2
)
View Source
const (
	ControlOk    = "ok"
	ControlAlarm = "alarm"
	ControlSkip  = "skip"
	ControlInfo  = "info"
	ControlError = "error"
)
View Source
const (
	DashboardServerDefaultPort    = 9194
	DashboardAssetsImageRefFormat = "us-docker.pkg.dev/steampipe/steampipe/assets:%s"
)
View Source
const (
	DefaultMaxConnections = 10

	ConnectionStatePending           = "pending"
	ConnectionStatePendingIncomplete = "incomplete"
	ConnectionStateReady             = "ready"
	ConnectionStateUpdating          = "updating"
	ConnectionStateDeleting          = "deleting"
	ConnectionStateDisabled          = "disabled"
	ConnectionStateError             = "error"
)
View Source
const (
	// SpinnerShowTimeout is the duration after which spinner should be shown
	SpinnerShowTimeout = 1 * time.Second

	MaxColumnWidth = 1024

	// NullString is the string which is displayed for null column values
	NullString = "<null>"
)

Display constants

View Source
const (
	EnvPipesHost       = "PIPES_HOST"
	EnvPipesToken      = "PIPES_TOKEN"
	EnvPipesInstallDir = "PIPES_INSTALL_DIR"
)

Environment Variables

View Source
const (
	LogLevelTrace = slog.Level(-8)
	LogLevelOff   = slog.Level(-16)
)
View Source
const (
	// A consistent detail message for all "not a valid identifier" diagnostics.
	BadIdentifierDetail = "A name must start with a letter or underscore and may contain only letters, digits, underscores, and dashes."
	BadDependsOn        = "Invalid depends_on"
)
View Source
const (
	ExitCodeSuccessful                  = 0
	ExitCodeControlsAlarm               = 1   // check - no runtime errors, 1 or more control alarms, no control errors
	ExitCodeControlsError               = 2   // check - no runtime errors, 1 or more control errors
	ExitCodePluginLoadingError          = 11  // plugin - loading error
	ExitCodePluginListFailure           = 12  // plugin - listing failed
	ExitCodePluginNotFound              = 13  // plugin - not found
	ExitCodePluginInstallFailure        = 14  // plugin - install failed
	ExitCodeSnapshotCreationFailed      = 21  // snapshot - creation failed
	ExitCodeSnapshotUploadFailed        = 22  // snapshot - upload failed
	ExitCodeServiceSetupFailure         = 31  // service - setup failed
	ExitCodeServiceStartupFailure       = 32  // service - start failed
	ExitCodeServiceStopFailure          = 33  // service - stop failed
	ExitCodeQueryExecutionFailed        = 41  // query - 1 or more queries failed - change in behavior(previously the exitCode used to be the number of queries that failed)
	ExitCodeLoginCloudConnectionFailed  = 51  // login - connecting to cloud failed
	ExitCodeModInitFailed               = 61  // mod - init failed
	ExitCodeModInstallFailed            = 62  // mod - install failed
	ExitCodeInvalidExecutionEnvironment = 249 // common - when steampipe is run in an unsupported environment
	ExitCodeInitializationFailed        = 250 // common - initialization failed
	ExitCodeBindPortUnavailable         = 251 // common(service/dashboard) - port binding failed
	ExitCodeNoModFile                   = 252 // common - no mod file
	ExitCodeFileSystemAccessFailure     = 253 // common - file system access failed
	ExitCodeInsufficientOrWrongInputs   = 254 // common - runtime error(insufficient or wrong input)
	ExitCodeUnknownErrorPanic           = 255 // common - runtime error(unknown panic)
)
View Source
const (
	PluginExtension   = ".plugin"
	SqlExtension      = ".sql"
	MarkdownExtension = ".md"

	JsonExtension     = ".json"
	CsvExtension      = ".csv"
	TextExtension     = ".txt"
	SnapshotExtension = ".pps"
	TokenExtension    = ".tptt"
	PipelineExtension = ".fp"
)

Original Steampipe values

View Source
const (
	InputTypeButton      = "button"
	InputTypeMultiSelect = "multiselect"
	InputTypeSelect      = "select"
	InputTypeText        = "text"
)
View Source
const (
	InputStyleInfo    = "info"
	InputStyleOk      = "ok"
	InputStyleAlert   = "alert"
	InputStyleDefault = "default"
)
View Source
const (
	IntrospectionNone    = "none"
	IntrospectionInfo    = "info"
	IntrospectionControl = "control"
)

constants for introspection config flag

View Source
const (
	OutputFormatCSV           = "csv"
	OutputFormatHTML          = "html"
	OutputFormatMD            = "md"
	OutputFormatJSON          = "json"
	OutputFormatTable         = "table"
	OutputFormatLine          = "line"
	OutputFormatNone          = "none"
	OutputFormatText          = "text"
	OutputFormatBrief         = "brief"
	OutputFormatSnapshot      = "snapshot"
	OutputFormatSnapshotShort = "pps"
	OutputFormatPretty        = "pretty"
	OutputFormatPlain         = "plain"
	OutputFormatYAML          = "yaml"
)
View Source
const (
	ArchAMD64 = "amd64"
	ArchARM64 = "arm64"
	OSLinux   = "linux"
	OSDarwin  = "darwin"
)
View Source
const (
	SmtpTlsRequired = "required"
	SmtpTlsOff      = "off"
	SmtpTlsAuto     = "auto"
)
View Source
const (
	TelemetryNone = "none"
	TelemetryInfo = "info"
)

constants for telemetry config flag

View Source
const DefaultFlowpipeWorkspaceContent = `` /* 705-byte string literal not displayed */
View Source
const DefaultMaxCacheSizeMb = 16384
View Source
const DefaultPowerpipeWorkspaceContent = `` /* 1211-byte string literal not displayed */

DefaultPowerpipeWorkspaceContent is the content of the sample workspaces config file(workspaces.spc.sample), that is created if it does not exist

View Source
const (
	PostgresNotificationChannel = "steampipe_notification"
)
View Source
const SteampipeHubOCIBase = "hub.steampipe.io/"

Variables

View Source
var (
	// OptLeftArrowASCIICode ::
	OptLeftArrowASCIICode = []byte{0x1b, 0x62}
	// OptRightArrowASCIICode ::
	OptRightArrowASCIICode = []byte{0x1b, 0x66}
	// AltLeftArrowASCIICode ::
	AltLeftArrowASCIICode = []byte{0x1b, 0x1b, 0x5B, 0x44}
	// AltRightArrowASCIICode ::
	AltRightArrowASCIICode = []byte{0x1b, 0x1b, 0x5B, 0x43}
)
View Source
var (
	ColoredErr  = color.RedString("Error")
	ColoredWarn = color.YellowString("Warning")
)
View Source
var (
	DashboardServiceStartTimeout = 30 * time.Second
	DBStartTimeout               = 30 * time.Second
	DBConnectionRetryBackoff     = 200 * time.Millisecond
	DBRecoveryTimeout            = 24 * time.Hour
	DBRecoveryRetryBackoff       = 200 * time.Millisecond
	ServicePingInterval          = 50 * time.Millisecond
)
View Source
var Black = aurora.Black
View Source
var Blink = aurora.Blink
View Source
var Blue = aurora.Blue
View Source
var Bold = aurora.Bold
View Source
var BrightBlack = aurora.BrightBlack
View Source
var BrightBlue = aurora.BrightBlue
View Source
var BrightCyan = aurora.BrightCyan
View Source
var BrightGreen = aurora.BrightGreen
View Source
var BrightMagenta = aurora.BrightMagenta
View Source
var BrightRed = aurora.BrightRed
View Source
var BrightWhite = aurora.BrightWhite
View Source
var BrightYellow = aurora.BrightYellow
View Source
var Colors = map[string]func(arg interface{}) aurora.Value{
	"bold":       Bold,
	"italic":     Italic,
	"underline":  Underline,
	"slow-blink": SlowBlink,

	"black":   Black,
	"red":     Red,
	"green":   Green,
	"yellow":  Yellow,
	"blue":    Blue,
	"magenta": Magenta,
	"cyan":    Cyan,
	"white":   White,

	"bold-black":   BoldBlack,
	"bold-red":     BoldRed,
	"bold-green":   BoldGreen,
	"bold-yellow":  BoldYellow,
	"bold-blue":    BoldBlue,
	"bold-magenta": BoldMagenta,
	"bold-cyan":    BoldCyan,
	"bold-white":   BoldWhite,

	"bright-black":   BrightBlack,
	"bright-red":     BrightRed,
	"bright-green":   BrightGreen,
	"bright-yellow":  BrightYellow,
	"bright-blue":    BrightBlue,
	"bright-magenta": BrightMagenta,
	"bright-cyan":    BrightCyan,
	"bright-white":   BrightWhite,

	"bold-bright-black":   BoldBrightBlack,
	"bold-bright-red":     BoldBrightRed,
	"bold-bright-green":   BoldBrightGreen,
	"bold-bright-yellow":  BoldBrightYellow,
	"bold-bright-blue":    BoldBrightBlue,
	"bold-bright-magenta": BoldBrightMagenta,
	"bold-bright-cyan":    BoldBrightCyan,
	"bold-bright-white":   BoldBrightWhite,

	"gray1": Gray1,
	"gray2": Gray2,
	"gray3": Gray3,
	"gray4": Gray4,
	"gray5": Gray5,
}

Colors is a map of string to aurora colour value

ConnectionStates is a handy array of all states

View Source
var Cyan = aurora.Cyan
View Source
var DashboardListenAddresses = []string{"localhost", "127.0.0.1"}

DashboardListenAddresses is an arrays is listen addresses which Steampipe accepts

View Source
var Green = aurora.Green
View Source
var Italic = aurora.Italic
View Source
var Magenta = aurora.Magenta
View Source
var Red = aurora.Red
View Source
var SlowBlink = aurora.SlowBlink
View Source
var TelemetryLevels = []string{TelemetryNone, TelemetryInfo}
View Source
var Underline = aurora.Underline
View Source
var White = aurora.White
View Source
var YamlExtensions = []string{".yml", ".yaml"}
View Source
var Yellow = aurora.Yellow

Functions

func BoldBlack

func BoldBlack(arg interface{}) aurora.Value

func BoldBlue

func BoldBlue(arg interface{}) aurora.Value

func BoldBrightBlack

func BoldBrightBlack(arg interface{}) aurora.Value

func BoldBrightBlue

func BoldBrightBlue(arg interface{}) aurora.Value

func BoldBrightCyan

func BoldBrightCyan(arg interface{}) aurora.Value

func BoldBrightGreen

func BoldBrightGreen(arg interface{}) aurora.Value

func BoldBrightMagenta

func BoldBrightMagenta(arg interface{}) aurora.Value

func BoldBrightRed

func BoldBrightRed(arg interface{}) aurora.Value

func BoldBrightWhite

func BoldBrightWhite(arg interface{}) aurora.Value

func BoldBrightYellow

func BoldBrightYellow(arg interface{}) aurora.Value

func BoldCyan

func BoldCyan(arg interface{}) aurora.Value

func BoldGreen

func BoldGreen(arg interface{}) aurora.Value

func BoldMagenta

func BoldMagenta(arg interface{}) aurora.Value

func BoldRed

func BoldRed(arg interface{}) aurora.Value

func BoldWhite

func BoldWhite(arg interface{}) aurora.Value

func BoldYellow

func BoldYellow(arg interface{}) aurora.Value

func BoolToEnableDisable

func BoolToEnableDisable(val bool) string

BoolToEnableDisable converts a boolean value onto the string "enable" or "disable"

func BoolToOnOff

func BoolToOnOff(val bool) string

BoolToOnOff converts a boolean value onto the string "on" or "off"

func DashboardAssetsImageRef

func DashboardAssetsImageRef() string

func Gray1

func Gray1(arg interface{}) aurora.Value

func Gray2

func Gray2(arg interface{}) aurora.Value

func Gray3

func Gray3(arg interface{}) aurora.Value

func Gray4

func Gray4(arg interface{}) aurora.Value

func Gray5

func Gray5(arg interface{}) aurora.Value

func IsValidInputStyleType added in v0.3.0

func IsValidInputStyleType(s string) bool

func IsValidInputType added in v0.3.0

func IsValidInputType(s string) bool

func IsValidSmtpTls added in v0.3.0

func IsValidSmtpTls(s string) bool

func IsYamlExtension

func IsYamlExtension(ext string) bool

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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