Documentation ¶
Index ¶
- Constants
- Variables
- func ArgFromMetaquery(cmd string) string
- func BoldBlack(arg interface{}) aurora.Value
- func BoldBlue(arg interface{}) aurora.Value
- func BoldBrightBlack(arg interface{}) aurora.Value
- func BoldBrightBlue(arg interface{}) aurora.Value
- func BoldBrightCyan(arg interface{}) aurora.Value
- func BoldBrightGreen(arg interface{}) aurora.Value
- func BoldBrightMagenta(arg interface{}) aurora.Value
- func BoldBrightRed(arg interface{}) aurora.Value
- func BoldBrightWhite(arg interface{}) aurora.Value
- func BoldBrightYellow(arg interface{}) aurora.Value
- func BoldCyan(arg interface{}) aurora.Value
- func BoldGreen(arg interface{}) aurora.Value
- func BoldMagenta(arg interface{}) aurora.Value
- func BoldRed(arg interface{}) aurora.Value
- func BoldWhite(arg interface{}) aurora.Value
- func BoldYellow(arg interface{}) aurora.Value
- func BoolToEnableDisable(val bool) string
- func BoolToOnOff(val bool) string
- func Gray1(arg interface{}) aurora.Value
- func Gray2(arg interface{}) aurora.Value
- func Gray3(arg interface{}) aurora.Value
- func Gray4(arg interface{}) aurora.Value
- func Gray5(arg interface{}) aurora.Value
- func IsYamlExtension(ext string) bool
- type Invoker
Constants ¶
const ( ArgHelp = "help" ArgVersion = "version" ArgForce = "force" ArgAll = "all" ArgTiming = "timing" ArgOn = "on" ArgOff = "off" ArgClear = "clear" ArgDatabasePort = "database-port" ArgDatabaseQueryTimeout = "query-timeout" ArgListenAddress = "database-listen" ArgServicePassword = "database-password" ArgServiceShowPassword = "show-password" ArgDashboard = "dashboard" ArgDashboardListen = "dashboard-listen" ArgDashboardPort = "dashboard-port" ArgForeground = "foreground" ArgInvoker = "invoker" ArgUpdateCheck = "update-check" ArgTelemetry = "telemetry" ArgInstallDir = "install-dir" ArgWorkspaceChDir = "workspace-chdir" ArgWorkspaceDatabase = "workspace-database" ArgSchemaComments = "schema-comments" ArgCloudHost = "cloud-host" ArgCloudToken = "cloud-token" ArgSearchPath = "search-path" ArgSearchPathPrefix = "search-path-prefix" ArgWatch = "watch" ArgTheme = "theme" ArgProgress = "progress" ArgExport = "export" ArgMaxParallel = "max-parallel" ArgLogLevel = "log-level" ArgDryRun = "dry-run" ArgWhere = "where" ArgTag = "tag" ArgVariable = "var" ArgVarFile = "var-file" ArgConnectionString = "connection-string" ArgCheckDisplayWidth = "check-display-width" ArgPrune = "prune" ArgModInstall = "mod-install" ArgServiceMode = "service-mode" ArgBrowser = "browser" ArgInput = "input" ArgDashboardInput = "dashboard-input" ArgMaxCacheSizeMb = "max-cache-size-mb" ArgCacheTtl = "cache-ttl" ArgClientCacheEnabled = "client-cache-enabled" ArgServiceCacheEnabled = "service-cache-enabled" ArgCacheMaxTtl = "cache-max-ttl" ArgIntrospection = "introspection" ArgSnapshot = "snapshot" ArgSnapshotTag = "snapshot-tag" ArgWorkspaceProfile = "workspace" ArgModLocation = "mod-location" ArgSnapshotLocation = "snapshot-location" ArgSnapshotTitle = "snapshot-title" ArgDatabaseStartTimeout = "database-start-timeout" ArgGitUrlMode = "git-url-mode" )
Argument name constants
const ( CmdNameQuery = "query" CmdNameCheck = "check" CmdNameDashboard = "dashboard" )
const ( ConfigKeyInteractive = "interactive" ConfigKeyActiveCommand = "cmd" ConfigKeyActiveCommandArgs = "cmd_args" ConfigInteractiveVariables = "interactive_var" ConfigKeyIsTerminalTTY = "is_terminal" ConfigKeyServerSearchPath = "server-search-path" ConfigKeyServerSearchPathPrefix = "server-search-path-prefix" )
viper config keys
const ( // MaxParallelClientInits is the number of clients to initialize in parallel // if we start initializing all clients together, it leads to bad performance on all MaxParallelClientInits = 3 // MaxBackups is the maximum number of backups that will be retained MaxBackups = 100 )
Client constants
const ( DatabaseDefaultPort = 9193 DatabaseDefaultCheckQueryTimeout = 240 DatabaseSuperUser = "root" DatabaseUser = "steampipe" DatabaseName = "steampipe" DatabaseUsersRole = "steampipe_users" DefaultMaxConnections = 10 )
const ( DatabaseVersion = "14.2.0" FdwVersion = "1.7.2" // PostgresImageRef is the OCI Image ref for the database binaries PostgresImageRef = "us-docker.pkg.dev/steampipe/steampipe/db:14.2.0" PostgresImageDigest = "sha256:a75637209f1bc2fa9885216f7972dfa0d82010a25d3cbfc07baceba8d16f4a93" FdwImageRef = "us-docker.pkg.dev/steampipe/steampipe/fdw:" + FdwVersion FdwBinaryFileName = "steampipe_postgres_fdw.so" )
constants for installing db and fdw images
const ( // legacy schema names // these are schema names which were used previously // but are not relevant anymore and need to be dropped LegacyInternalSchema = "internal" // InternalSchema is the schema container for all steampipe helper functions, and connection state table // also used to send commands to the FDW InternalSchema = "steampipe_internal" // ConnectionStateTable is the table used to store steampipe connection state ConnectionStateTable = "steampipe_connection_state" ConnectionStatePending = "pending" ConnectionStatePendingIncomplete = "incomplete" ConnectionStateReady = "ready" ConnectionStateUpdating = "updating" ConnectionStateDeleting = "deleting" ConnectionStateDisabled = "disabled" ConnectionStateError = "error" // foreign tables in internal schema ForeignTableScanMetadata = "steampipe_scan_metadata" ForeignTableSettings = "steampipe_settings" ForeignTableSettingsKeyColumn = "name" ForeignTableSettingsValueColumn = "value" ForeignTableSettingsCacheKey = "cache" ForeignTableSettingsCacheTtlKey = "cache_ttl" ForeignTableSettingsCacheClearTimeKey = "cache_clear_time" FunctionCacheSet = "meta_cache" FunctionCacheSetTtl = "meta_cache_ttl" // legacy LegacyCommandSchema = "steampipe_command" LegacyCommandTableCache = "cache" LegacyCommandTableCacheOperationColumn = "operation" LegacyCommandCacheOn = "cache_on" LegacyCommandCacheOff = "cache_off" LegacyCommandCacheClear = "cache_clear" LegacyCommandTableScanMetadata = "scan_metadata" )
schema names
const ( IntrospectionTableQuery = "steampipe_query" IntrospectionTableControl = "steampipe_control" IntrospectionTableBenchmark = "steampipe_benchmark" IntrospectionTableMod = "steampipe_mod" IntrospectionTableDashboard = "steampipe_dashboard" IntrospectionTableDashboardContainer = "steampipe_dashboard_container" IntrospectionTableDashboardCard = "steampipe_dashboard_card" IntrospectionTableDashboardChart = "steampipe_dashboard_chart" IntrospectionTableDashboardFlow = "steampipe_dashboard_flow" IntrospectionTableDashboardGraph = "steampipe_dashboard_graph" IntrospectionTableDashboardHierarchy = "steampipe_dashboard_hierarchy" IntrospectionTableDashboardImage = "steampipe_dashboard_image" IntrospectionTableDashboardInput = "steampipe_dashboard_input" IntrospectionTableDashboardTable = "steampipe_dashboard_table" IntrospectionTableDashboardText = "steampipe_dashboard_text" IntrospectionTableVariable = "steampipe_variable" IntrospectionTableReference = "steampipe_reference" )
introspection table names
const ( // InvokerService is set when invoked by `service start` InvokerService Invoker = "service" // InvokerQuery is set when invoked by query command InvokerQuery = "query" // InvokerCheck is set when invoked by check command InvokerCheck = "check" // InvokerPlugin is set when invoked by a plugin command InvokerPlugin = "plugin" // InvokerDashboard is set when invoked by dashboard command InvokerDashboard = "dashboard" // InvokerConnectionWatcher is set when invoked by the connection watcher process InvokerConnectionWatcher = "connection-watcher" )
const ( AppName = "steampipe" EnvUpdateCheck = "STEAMPIPE_UPDATE_CHECK" EnvInstallDir = "STEAMPIPE_INSTALL_DIR" EnvInstallDatabase = "STEAMPIPE_INITDB_DATABASE_NAME" EnvServicePassword = "STEAMPIPE_DATABASE_PASSWORD" //nolint:gosec // expected EnvMaxParallel = "STEAMPIPE_MAX_PARALLEL" EnvDatabaseStartTimeout = "STEAMPIPE_DATABASE_START_TIMEOUT" EnvSnapshotLocation = "STEAMPIPE_SNAPSHOT_LOCATION" EnvWorkspaceDatabase = "STEAMPIPE_WORKSPACE_DATABASE" EnvWorkspaceProfile = "STEAMPIPE_WORKSPACE" EnvCloudHost = "STEAMPIPE_CLOUD_HOST" EnvCloudToken = "STEAMPIPE_CLOUD_TOKEN" //nolint:gosec // expected EnvPipesHost = "PIPES_HOST" EnvPipesToken = "PIPES_TOKEN" EnvCheckDisplayWidth = "STEAMPIPE_CHECK_DISPLAY_WIDTH" EnvDisplayWidth = "STEAMPIPE_DISPLAY_WIDTH" EnvCacheEnabled = "STEAMPIPE_CACHE" EnvCacheTTL = "STEAMPIPE_CACHE_TTL" EnvCacheMaxTTL = "STEAMPIPE_CACHE_MAX_TTL" EnvCacheMaxSize = "STEAMPIPE_CACHE_MAX_SIZE_MB" EnvQueryTimeout = "STEAMPIPE_QUERY_TIMEOUT" EnvConnectionWatcher = "STEAMPIPE_CONNECTION_WATCHER" EnvWorkspaceChDir = "STEAMPIPE_WORKSPACE_CHDIR" EnvModLocation = "STEAMPIPE_MOD_LOCATION" EnvTelemetry = "STEAMPIPE_TELEMETRY" EnvIntrospection = "STEAMPIPE_INTROSPECTION" EnvWorkspaceProfileLocation = "STEAMPIPE_WORKSPACE_PROFILES_LOCATION" EnvDiagnostics = "STEAMPIPE_DIAGNOSTICS" // EnvInputVarPrefix is the prefix for environment variables that represent values for input variables. EnvInputVarPrefix = "SP_VAR_" )
Environment Variables
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" )
const ( PluginExtension = ".plugin" ConfigExtension = ".spc" SqlExtension = ".sql" MarkdownExtension = ".md" ModDataExtension = ".sp" VariablesExtension = ".spvars" AutoVariablesExtension = ".auto.spvars" JsonExtension = ".json" CsvExtension = ".csv" TextExtension = ".txt" SnapshotExtension = ".sps" TokenExtension = ".tptt" LegacyTokenExtension = ".sptt" PipelineExtension = ".fp" )
Original Steampipe values
const ( IntrospectionNone = "none" IntrospectionInfo = "info" IntrospectionControl = "control" )
constants for introspection config flag
const ( CmdTableList = ".tables" // List all tables CmdOutput = ".output" // Set output mode CmdTiming = ".timing" // Toggle query timer CmdHeaders = ".header" // Toggle headers output CmdSeparator = ".separator" // Set the column separator CmdExit = ".exit" // Exit the interactive prompt CmdQuit = ".quit" // Alias for .exit CmdInspect = ".inspect" // inspect CmdConnections = ".connections" // list all connections CmdMulti = ".multi" // toggle multi line query CmdClear = ".clear" // clear the console CmdHelp = ".help" // list all meta commands CmdSearchPath = ".search_path" // Set or show search-path CmdSearchPathPrefix = ".search_path_prefix" // set search path prefix CmdCache = ".cache" // cache control CmdCacheTtl = ".cache_ttl" // set cache ttl CmdAutoComplete = ".autocomplete" // enable or disable auto complete )
const ( ArchAMD64 = "amd64" ArchARM64 = "arm64" OSLinux = "linux" OSDarwin = "darwin" )
const ( TelemetryNone = "none" TelemetryInfo = "info" )
constants for telemetry config flag
const DefaultMaxCacheSizeMb = 16384
const ReservedConnectionNamePrefix = "steampipe_"
Variables ¶
var ( ColoredErr = color.RedString("Error") ColoredWarn = color.YellowString("Warning") )
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 )
var ArgAutoComplete = ArgFromMetaquery(CmdAutoComplete)
var ArgHeader = ArgFromMetaquery(CmdHeaders)
var ArgMultiLine = ArgFromMetaquery(CmdMulti)
var ArgOutput = ArgFromMetaquery(CmdOutput)
var ArgSeparator = ArgFromMetaquery(CmdSeparator)
var Black = aurora.Black
var Blink = aurora.Blink
var Blue = aurora.Blue
var Bold = aurora.Bold
var BrightBlack = aurora.BrightBlack
var BrightBlue = aurora.BrightBlue
var BrightCyan = aurora.BrightCyan
var BrightGreen = aurora.BrightGreen
var BrightMagenta = aurora.BrightMagenta
var BrightRed = aurora.BrightRed
var BrightWhite = aurora.BrightWhite
var BrightYellow = aurora.BrightYellow
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
var ConnectionConfigExtensions = append(YamlExtensions, ConfigExtension, JsonExtension)
var ConnectionStates = []string{ ConnectionStateTable, ConnectionStatePending, ConnectionStateReady, ConnectionStateUpdating, ConnectionStateDeleting, ConnectionStateError, }
ConnectionStates is a handy array of all states
var Cyan = aurora.Cyan
var DatabaseListenAddresses = []string{"localhost", "127.0.0.1"}
DatabaseListenAddresses is an arrays is listen addresses which Steampipe accepts
var Green = aurora.Green
var Italic = aurora.Italic
var Magenta = aurora.Magenta
var PipesComponentAppName = AppName
var PipesComponentAutoVariablesExtension = AutoVariablesExtension
var PipesComponentEnvInputVarPrefix = EnvInputVarPrefix
var PipesComponentModDataExtension = ModDataExtension
Pipes Components overrides
var PipesComponentVariablesExtension = VariablesExtension
var Red = aurora.Red
var ReservedConnectionNames = []string{
"public",
}
var SlowBlink = aurora.SlowBlink
var TelemetryLevels = []string{TelemetryNone, TelemetryInfo}
var Underline = aurora.Underline
var White = aurora.White
var YamlExtensions = []string{".yml", ".yaml"}
var Yellow = aurora.Yellow
Functions ¶
func ArgFromMetaquery ¶
ArgFromMetaquery converts a metaquery of form '.header' into the config argument used to set the mode, i.e. 'header'
func BoldBrightBlack ¶
func BoldBrightBlue ¶
func BoldBrightCyan ¶
func BoldBrightGreen ¶
func BoldBrightMagenta ¶
func BoldBrightRed ¶
func BoldBrightWhite ¶
func BoldBrightYellow ¶
func BoldMagenta ¶
func BoldYellow ¶
func BoolToEnableDisable ¶
BoolToEnableDisable converts a boolean value onto the string "enable" or "disable"
func BoolToOnOff ¶
BoolToOnOff converts a boolean value onto the string "on" or "off"