Documentation ¶
Index ¶
- Constants
- Variables
- func ArgFromMetaquery(cmd string) string
- func BoolToEnableDisable(val bool) string
- func BoolToOnOff(val bool) string
- func ConfigDir() string
- func ConnectionStatePath() string
- func DatabaseDir() string
- func InternalDir() string
- func LogDir() string
- func ModsDir() string
- func PluginDir() string
- func TempDir() string
Constants ¶
const ( ArgJSON = "json" ArgCSV = "csv" ArgTable = "table" ArgLine = "line" ArgListAllTableNames = "L" ArgSelectAll = "A" ArgForce = "force" ArgTimer = "timing" ArgOn = "on" ArgOff = "off" ArgPortDeprecated = "db-port" ArgPort = "database-port" ArgListenAddressDeprecated = "listen" ArgListenAddress = "database-listen" ArgInvoker = "invoker" ArgRefresh = "refresh" ArgLogLevel = "log-level" ArgUpdateCheck = "update-check" ArgInstallDir = "install-dir" )
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 )
Metaquery commands
const ( DefaultInstallDir = "~/.steampipe" PluginExtension = ".plugin" ConfigExtension = ".spc" ConnectionsStateFileName = "connection.json" )
Constants for Config
const ( DatabaseHost = "localhost" DatabaseDefaultPort = 9193 DatabaseSuperUser = "root" DatabaseUser = "steampipe" DatabaseName = "steampipe" )
const ( DatabaseVersion = "12.1.0" FdwVersion = "0.0.29" // 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 ( // 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 ( HistoryFile = "history.json" // File to store historical data HistorySize = 100 // Number of historical records to store )
Constants for History
const (
APPNAME = "steampipe"
)
Application constants
const DefaultSPCContent = `` /* 531-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 (
ENV_UPDATE_CHECK = "STEAMPIPE_UPDATE_CHECK"
)
Known Environment Variables
const FunctionSchema = "internal"
FunctionSchema :: schema container for all steampipe helper functions
const (
ModDataExtension = "sp"
)
mod related constants
const PgHbaContent = `` /* 5133-byte string literal not displayed */
const (
// ShowInteractiveOutputConfigKey :: viper key
ShowInteractiveOutputConfigKey = "show-interactive-output"
)
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)
/ metaquery mode arguments
var ArgSeparator = ArgFromMetaquery(CmdSeparator)
var Bold = color.New(color.Bold).SprintFunc()
var DatabaseListenAddresses = []string{"localhost", "127.0.0.1"}
Arrays cannot be constants, so do the next most convenient thing
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 Red = color.New(color.FgRed).SprintFunc()
var ReservedConnectionNames = []string{ "public", FunctionSchema, }
var SteampipeDir string
Functions ¶
func ArgFromMetaquery ¶ added in v0.1.1
ArgFromMetaquery :: convert metaquery of form '.header' into the config argument used to set the mode, i.e. 'header'
func BoolToEnableDisable ¶ added in v0.1.1
BoolToEnableDisable :: convert a boolean value onto the string "enable" or "disable"
func BoolToOnOff ¶ added in v0.1.1
BoolToOnOff :: convert 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 InternalDir ¶
func InternalDir() string
InternalDir :: returns the path to the internal directory (creates if missing)
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)
Types ¶
This section is empty.