constants

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArgJSON                    = "json"
	ArgCSV                     = "csv"
	ArgTable                   = "table"
	ArgLine                    = "line"
	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"
	ArgWorkspace               = "workspace"
	ArgSearchPath              = "search-path"
	ArgSearchPathPrefix        = "search-path-prefix"
	ArgWatch                   = "watch"
	//ArgWhere                   = "where"
	ArgTheme    = "theme"
	ArgProgress = "progress"
)

Argument name constants

View Source
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
)

Metaquery commands

View Source
const (
	DefaultInstallDir        = "~/.steampipe"
	ConnectionsStateFileName = "connection.json"
)

Constants for Config

View Source
const (
	ConfigKeyShowInteractiveOutput = "show-interactive-output"
	ConfigKeyDatabaseSearchPath    = "database.search-path"
	ConfigKeyInteractive           = "interactive"
	ConfigKeyActiveCommand         = "cmd"
	ConfigKeyActiveCommandArgs     = "cmd_args"
)

viper config keys

View Source
const (
	DatabaseHost        = "localhost"
	DatabaseDefaultPort = 9193
	DatabaseSuperUser   = "root"
	DatabaseUser        = "steampipe"
	DatabaseName        = "steampipe"
)
View Source
const (
	DatabaseVersion = "12.1.0"
	FdwVersion      = "0.0.38"

	// 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

View Source
const (
	ReflectionTableQuery     = "steampipe_query"
	ReflectionTableControl   = "steampipe_control"
	ReflectionTableBenchmark = "steampipe_benchmark"
	ReflectionTableMod       = "steampipe_mod"
)

reflection table names

View Source
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

View Source
const (
	PluginExtension  = ".plugin"
	ConfigExtension  = ".spc"
	SqlExtension     = ".sql"
	ModDataExtension = ".sp"
)
View Source
const (
	HistoryFile = "history.json" // File to store historical data
	HistorySize = 100            // Number of historical records to store
)

Constants for History

View Source
const (
	WorkspaceModDir         = "mods"
	WorkspaceDataDir        = ".steampipe"
	WorkspaceConfigFileName = "workspace.spc"
	WorkspaceIgnoreFile     = ".steampipeignore"
	WorkspaceDefaultModName = "local"
)

mod related constants

View Source
const (
	APPNAME = "steampipe"
)

Application constants

View Source
const DefaultSPCContent = `` /* 918-byte string literal not displayed */
View Source
const EEXISTS = "EEXISTS"

EEXISTS :: universal error string to denote that a resource already exists

View Source
const ENOTEXISTS = "ENOTEXISTS"

ENOTEXISTS :: universal error string to denote that a resource does not exists

View Source
const (
	ENV_UPDATE_CHECK = "STEAMPIPE_UPDATE_CHECK"
)

Known Environment Variables

View Source
const (
	// FunctionSchema :: schema container for all steampipe helper functions
	FunctionSchema = "internal"
)

schema names

View Source
const PgHbaContent = `` /* 5133-byte string literal not displayed */

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 ArgMultiLine = ArgFromMetaquery(CmdMulti)

/ metaquery mode arguments

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

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

Arrays cannot be constants, so do the next most convenient thing

View Source
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

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 ReservedConnectionNames = []string{
	"public",
	FunctionSchema,
}
View Source
var SlowBlink = aurora.SlowBlink
View Source
var SteampipeDir string
View Source
var Underline = aurora.Underline
View Source
var White = aurora.White
View Source
var Yellow = aurora.Yellow

Functions

func ArgFromMetaquery added in v0.1.1

func ArgFromMetaquery(cmd string) string

ArgFromMetaquery converts a metaquery of form '.header' into the config argument used to set the mode, i.e. 'header'

func BoldBlack added in v0.5.0

func BoldBlack(arg interface{}) aurora.Value

func BoldBlue added in v0.5.0

func BoldBlue(arg interface{}) aurora.Value

func BoldBrightBlack added in v0.5.0

func BoldBrightBlack(arg interface{}) aurora.Value

func BoldBrightBlue added in v0.5.0

func BoldBrightBlue(arg interface{}) aurora.Value

func BoldBrightCyan added in v0.5.0

func BoldBrightCyan(arg interface{}) aurora.Value

func BoldBrightGreen added in v0.5.0

func BoldBrightGreen(arg interface{}) aurora.Value

func BoldBrightMagenta added in v0.5.0

func BoldBrightMagenta(arg interface{}) aurora.Value

func BoldBrightRed added in v0.5.0

func BoldBrightRed(arg interface{}) aurora.Value

func BoldBrightWhite added in v0.5.0

func BoldBrightWhite(arg interface{}) aurora.Value

func BoldBrightYellow added in v0.5.0

func BoldBrightYellow(arg interface{}) aurora.Value

func BoldCyan added in v0.5.0

func BoldCyan(arg interface{}) aurora.Value

func BoldGreen added in v0.5.0

func BoldGreen(arg interface{}) aurora.Value

func BoldMagenta added in v0.5.0

func BoldMagenta(arg interface{}) aurora.Value

func BoldRed added in v0.5.0

func BoldRed(arg interface{}) aurora.Value

func BoldWhite added in v0.5.0

func BoldWhite(arg interface{}) aurora.Value

func BoldYellow added in v0.5.0

func BoldYellow(arg interface{}) aurora.Value

func BoolToEnableDisable added in v0.1.1

func BoolToEnableDisable(val bool) string

BoolToEnableDisable :: convert a boolean value onto the string "enable" or "disable"

func BoolToOnOff added in v0.1.1

func BoolToOnOff(val bool) string

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 Gray1 added in v0.5.0

func Gray1(arg interface{}) aurora.Value

func Gray2 added in v0.5.0

func Gray2(arg interface{}) aurora.Value

func Gray3 added in v0.5.0

func Gray3(arg interface{}) aurora.Value

func Gray4 added in v0.5.0

func Gray4(arg interface{}) aurora.Value

func Gray5 added in v0.5.0

func Gray5(arg interface{}) aurora.Value

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)

func PluginDir

func PluginDir() string

PluginDir :: returns the path to the plugins directory (creates if missing)

func ReflectionTableNames added in v0.5.0

func ReflectionTableNames() []string

func TempDir added in v0.1.3

func TempDir() string

TempDir :: returns the path to the steampipe tmp directory (creates if missing)

func WorkspaceModPath added in v0.4.0

func WorkspaceModPath(workspacePath string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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