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 ConfigDir() string
- func ConnectionStatePath() string
- func DatabaseDir() string
- func DatabaseVersionFilePath() string
- func DefaultVarsFilePath(workspacePath string) 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 InternalDir() string
- func IntrospectionTableNames() []string
- func IsYamlExtension(ext string) bool
- func LegacyVersionFilePath() string
- func LogDir() string
- func ModsDir() string
- func PluginDir() string
- func PluginManagerStateFilePath() string
- func PluginVersionFilePath() string
- func RunningInfoFilePath() string
- func TempDir() string
- func WorkspaceModPath(workspacePath string) string
- type Invoker
Constants ¶
const ( ArgHelp = "help" ArgVersion = "version" ArgForce = "force" ArgAll = "all" ArgTimer = "timing" ArgOn = "on" ArgOff = "off" ArgClear = "clear" ArgPort = "database-port" ArgListenAddress = "database-listen" ArgServicePassword = "database-password" ArgForeground = "foreground" ArgInvoker = "invoker" ArgUpdateCheck = "update-check" ArgInstallDir = "install-dir" ArgWorkspace = "workspace" 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" ArgDryRun = "dry-run" ArgWhere = "where" ArgTag = "tag" ArgVariable = "var" ArgVarFile = "var-file" ArgConnectionString = "connection-string" ArgCheckDisplayWidth = "check-display-width" )
Argument name constants
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 )
Metaquery commands
const ( ConfigKeyShowInteractiveOutput = "show-interactive-output" // ConfigKeyDatabaseSearchPath is used to store the search path set in the database config in viper // the viper value will be set via via a call to getScopedKey in steampipeconfig/steampipeconfig.go ConfigKeyDatabaseSearchPath = "database.search-path" ConfigKeyInteractive = "interactive" ConfigKeyActiveCommand = "cmd" ConfigKeyActiveCommandArgs = "cmd_args" ConfigInteractiveVariables = "interactive_var" )
viper config keys
const ( ControlOk = "ok" ControlAlarm = "alarm" ControlSkip = "skip" ControlInfo = "info" ControlError = "error" )
const ( DatabaseDefaultPort = 9193 DatabaseSuperUser = "root" DatabaseUser = "steampipe" DatabaseName = "steampipe" DatabaseUsersRole = "steampipe_users" DefaultMaxConnections = 5 )
const ( DatabaseVersion = "12.1.0" FdwVersion = "0.3.1-dev.0" // DefaultEmbeddedPostgresImage :: The 12.1.0 image uses the older jar format 12.1.0-v2 is the same version of postgres, // just packaged as gzipped tar files (consistent with oras, faster to unzip). Once everyone is // on a newer build, we can delete the old image move the 12.1.0 tag to the new image, and // change this back for consistency //DefaultEmbeddedPostgresImage = "us-docker.pkg.dev/steampipe/steampipe/db:" + DatabaseVersion DefaultEmbeddedPostgresImage = "us-docker.pkg.dev/steampipe/steampipe/db:12.1.0-v2" DefaultFdwImage = "us-docker.pkg.dev/steampipe/steampipe/fdw:" + FdwVersion )
constants for installing db and fdw images
const ( // FunctionSchema :: schema container for all steampipe helper functions FunctionSchema = "internal" // CommandSchema is the schema which is used to send commands to the FDW CommandSchema = "steampipe_command" CacheCommandTable = "cache" CacheCommandOperationColumn = "operation" CommandCacheOn = "cache_on" CommandCacheOff = "cache_off" CommandCacheClear = "cache_clear" )
schema names
const ( IntrospectionTableQuery = "steampipe_query" IntrospectionTableControl = "steampipe_control" IntrospectionTableBenchmark = "steampipe_benchmark" IntrospectionTableMod = "steampipe_mod" 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" // InvokerReport is set when invoked by report command InvokerReport = "report" // InvokerConnectionWatcher is set when invoked by the connection watcher process InvokerConnectionWatcher = "connection-watcher" )
const ( // SpinnerShowTimeout :: duration after which spinner should be shown SpinnerShowTimeout = 1 * time.Second // Max Column Width MaxColumnWidth = 1024 // what do we display for null column values NullString = "<null>" )
Display constants
const ( EnvUpdateCheck = "STEAMPIPE_UPDATE_CHECK" EnvInstallDir = "STEAMPIPE_INSTALL_DIR" EnvInstallDatabase = "STEAMPIPE_INITDB_DATABASE_NAME" EnvServicePassword = "STEAMPIPE_DATABASE_PASSWORD" EnvMaxParallel = "STEAMPIPE_MAX_PARALLEL" EnvWorkspaceDatabase = "STEAMPIPE_WORKSPACE_DATABASE" EnvCloudHost = "STEAMPIPE_CLOUD_HOST" EnvCloudToken = "STEAMPIPE_CLOUD_TOKEN" EnvCheckDisplayWidth = "STEAMPIPE_CHECK_DISPLAY_WIDTH" EnvCacheEnabled = "STEAMPIPE_CACHE" EnvCacheTTL = "STEAMPIPE_CACHE_TTL" EnvConnectionWatcher = "STEAMPIPE_CONNECTION_WATCHER" EnvWorkspaceChDir = "STEAMPIPE_WORKSPACE_CHDIR" // EnvInputVarPrefix is the prefix for environment variables that represent values for input variables. EnvInputVarPrefix = "SP_VAR_" )
Known Environment Variables
const ( PluginExtension = ".plugin" ConfigExtension = ".spc" SqlExtension = ".sql" MarkdownExtension = ".md" ModDataExtension = ".sp" VariablesExtension = ".spvars" AutoVariablesExtension = ".auto.spvars" JsonExtension = ".json" )
const ( DefaultInstallDir = "~/.steampipe" ConnectionsStateFileName = "connection.json" )
Constants for Config
const ( HistoryFile = "history.json" // File to store historical data HistorySize = 500 // Number of historical records to store )
Constants for History
const ( OutputFormatNone = "none" OutputFormatText = "text" OutputFormatBrief = "brief" OutputFormatCSV = "csv" OutputFormatJSON = "json" OutputFormatHTML = "html" OutputFormatMarkdown = "md" OutputFormatTable = "table" OutputFormatLine = "line" )
const ( ServerCertKey = "server.key" RootCertKey = "root.key" ServerCert = "server.crt" RootCert = "root.crt" SslConfDir = "/etc/ssl" )
constants for ssl key and certificate
const ( WorkspaceDataDir = ".steampipe" WorkspaceModDir = "mods" WorkspaceConfigFileName = "workspace.spc" WorkspaceIgnoreFile = ".steampipeignore" WorkspaceDefaultModName = "local" WorkspaceModFileName = "mod.sp" DefaultVarsFileName = "steampipe.spvars" MaxControlRunAttempts = 2 )
mod related constants
const (
AppName = "steampipe"
)
Application constants
const DefaultSPCContent = `` /* 918-byte string literal not displayed */
const EEXISTS = "EEXISTS"
EEXISTS :: universal error string to denote that a resource already exists
const ENOTEXISTS = "ENOTEXISTS"
ENOTEXISTS :: universal error string to denote that a resource does not exists
const ( // the number of clients to initialize in parallel // if we start initializing all clients together, it leads to bad performance on all MaxParallelClientInits = 3 )
dbClient constants
const ParallelControlMultiplier = 3
ParallelControlMultiplier is used to determine the nbumber of goroutines to start for the control run this is a multiplier for the max db connections which are configred
const PostgresqlConfContent = `` /* 572-byte string literal not displayed */
const QueryCancellationTimeout = 30
The maximum number of seconds to wait for control queries to finish cancelling
const SteampipeConfContent = `` /* 1563-byte string literal not displayed */
Variables ¶
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} )
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 Cyan = aurora.Cyan
var DatabaseListenAddresses = []string{"localhost", "127.0.0.1"}
DatabaseListenAddresses is an arrays is listen addresses which Steampipe accepts
var Functions = []schema.SQLFunc{ { Name: "glob", Params: map[string]string{"input_glob": "text"}, Returns: "text", Language: "plpgsql", Body: ` declare output_pattern text; begin output_pattern = replace(input_glob, '*', '%'); output_pattern = replace(output_pattern, '?', '_'); return output_pattern; end; `, }, }
Functions :: a list of SQLFunc objects that are installed in the db 'internal' schema startup
var Green = aurora.Green
var Italic = aurora.Italic
var Magenta = aurora.Magenta
var MinimalPgHbaContent string = `
hostssl all root samehost trust
host all root samehost trust
`
var PgHbaTemplate string = `` /* 1099-byte string literal not displayed */
PgHbaTemplate is to be formatted with two variables:
- databaseName
- username
Example:
fmt.Sprintf(template, datName, username)
var Red = aurora.Red
var ReservedConnectionNames = []string{ "public", FunctionSchema, }
var SlowBlink = aurora.SlowBlink
var SteampipeDir string
var Underline = aurora.Underline
var White = aurora.White
var YamlExtensions = []string{".yml", ".yaml"}
var Yellow = aurora.Yellow
Functions ¶
func ArgFromMetaquery ¶ added in v0.1.1
ArgFromMetaquery converts a metaquery of form '.header' into the config argument used to set the mode, i.e. 'header'
func BoldBrightBlack ¶ added in v0.5.0
func BoldBrightBlue ¶ added in v0.5.0
func BoldBrightCyan ¶ added in v0.5.0
func BoldBrightGreen ¶ added in v0.5.0
func BoldBrightMagenta ¶ added in v0.5.0
func BoldBrightRed ¶ added in v0.5.0
func BoldBrightWhite ¶ added in v0.5.0
func BoldBrightYellow ¶ added in v0.5.0
func BoldMagenta ¶ added in v0.5.0
func BoldYellow ¶ added in v0.5.0
func BoolToEnableDisable ¶ added in v0.1.1
BoolToEnableDisable converts a boolean value onto the string "enable" or "disable"
func BoolToOnOff ¶ added in v0.1.1
BoolToOnOff converts a boolean value onto the string "on" or "off"
func ConfigDir ¶
func ConfigDir() string
ConfigDir returns the path to the config directory (creates if missing)
func ConnectionStatePath ¶
func ConnectionStatePath() string
ConnectionStatePath returns the path of the connections state file
func DatabaseDir ¶
func DatabaseDir() string
DatabaseDir returns the path to the db directory (creates if missing)
func DatabaseVersionFilePath ¶ added in v0.7.0
func DatabaseVersionFilePath() string
DatabaseVersionFilePath returns the plugin version file path
func DefaultVarsFilePath ¶ added in v0.8.0
func InternalDir ¶
func InternalDir() string
InternalDir returns the path to the internal directory (creates if missing)
func IntrospectionTableNames ¶ added in v0.9.0
func IntrospectionTableNames() []string
func IsYamlExtension ¶ added in v0.9.0
func LegacyVersionFilePath ¶ added in v0.7.0
func LegacyVersionFilePath() string
LegacyVersionFilePath returns the legacy version file path
func LogDir ¶ added in v0.3.0
func LogDir() string
LogDir returns the path to the db log directory (creates if missing)
func ModsDir ¶
func ModsDir() string
ModsDir returns the path to the mods directory (creates if missing)
func PluginDir ¶
func PluginDir() string
PluginDir returns the path to the plugins directory (creates if missing)
func PluginManagerStateFilePath ¶ added in v0.10.0
func PluginManagerStateFilePath() string
func PluginVersionFilePath ¶ added in v0.7.0
func PluginVersionFilePath() string
PluginVersionFilePath returns the plugin version file path
func RunningInfoFilePath ¶ added in v0.10.0
func RunningInfoFilePath() string
func TempDir ¶ added in v0.1.3
func TempDir() string
TempDir returns the path to the steampipe tmp directory (creates if missing)