steampipeconfig

package
v0.7.1-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const CacheEnabledEnvVar = "STEAMPIPE_CACHE"
View Source
const CacheTTLEnvVar = "STEAMPIPE_CACHE_TTL"

Variables

This section is empty.

Functions

func BuildValidationWarningString

func BuildValidationWarningString(failures []*ValidationFailure) string

func GetModFileExtensions added in v0.4.0

func GetModFileExtensions() []string

GetModFileExtensions :: return list of all file extensions we care about this will be the mod data extension, plus any registered extensions registered in fileToResourceMap

func GetPluginPath

func GetPluginPath(remoteSchema string) (string, error)

func HandleGrpcError

func HandleGrpcError(err error, connection, call string) error

func LoadMod added in v0.4.0

func LoadMod(modPath string, opts *parse.ParseModOptions) (mod *modconfig.Mod, err error)

LoadMod :: parse all hcl files in modPath and return a single mod if CreatePseudoResources flag is set, construct hcl resources for files with specific extensions NOTE: it is an error if there is more than 1 mod defined, however zero mods is acceptable - a default mod will be created assuming there are any resource files

func LoadModDependencies added in v0.4.0

func LoadModDependencies(m *modconfig.Mod, modsFolder string, modMap modconfig.ModMap, deep bool) error

if deep is false only load single level of dependencies - if true load full tree (tbd if this is needed)

func PluginFQNToSchemaName

func PluginFQNToSchemaName(pluginFQN string) string

schemas in postgres are limited to 63 chars - the name may be longer than this, in which case trim the length and add a hash to the end to make unique

func SaveConnectionState

func SaveConnectionState(state ConnectionMap) error

func ValidatePlugins

func ValidatePlugins(updates ConnectionMap, plugins []*ConnectionPlugin) ([]*ValidationFailure, ConnectionMap, []*ConnectionPlugin)

Types

type ConnectionData

type ConnectionData struct {
	// the fully qualified name of the plugin
	Plugin string `yaml:"plugin"`
	// the checksum of the plugin file
	CheckSum string `yaml:"checkSum"`
	// connection name
	ConnectionName string
	// connection data (unparsed)
	ConnectionConfig string
	// steampipe connection options
	ConnectionOptions *options.Connection
}

ConnectionData is a struct containing all details for a connection - the plugin name and checksum, the connection config and options

func (ConnectionData) Equals added in v0.4.0

func (p ConnectionData) Equals(other *ConnectionData) bool

type ConnectionMap

type ConnectionMap map[string]*ConnectionData

func GetConnectionState

func GetConnectionState(schemas []string) (ConnectionMap, error)

GetConnectionState :: load connection state file, and remove any connections which do not exist in the db

func (ConnectionMap) Equals added in v0.4.0

func (m ConnectionMap) Equals(other ConnectionMap) bool

type ConnectionPlugin

type ConnectionPlugin struct {
	ConnectionName    string
	ConnectionConfig  string
	ConnectionOptions *options.Connection
	PluginName        string
	Plugin            *grpc.PluginClient
	Schema            *proto.Schema
}

ConnectionPlugin :: structure representing an instance of a plugin NOTE: currently this corresponds to a single connection, i.e. we have 1 plugin instance per connection

func CreateConnectionPlugin

func CreateConnectionPlugin(input *ConnectionPluginInput) (*ConnectionPlugin, error)

CreateConnectionPlugin :: instantiate a plugin for a connection, fetch schema and send connection config

type ConnectionPluginInput

type ConnectionPluginInput struct {
	ConnectionName    string
	PluginName        string
	ConnectionConfig  string
	ConnectionOptions *options.Connection
	DisableLogger     bool
}

ConnectionPluginInput :: struct used as input to CreateConnectionPlugin - it contains all details necessary to instantiate a ConnectionPlugin

type ConnectionUpdates

type ConnectionUpdates struct {
	Update         ConnectionMap
	Delete         ConnectionMap
	MissingPlugins []string
	// the connections which will exist after the update
	RequiredConnections ConnectionMap
}

func GetConnectionsToUpdate

func GetConnectionsToUpdate(schemas []string, connectionConfig map[string]*modconfig.Connection) (*ConnectionUpdates, error)

GetConnectionsToUpdate :: returns updates to be made to the database to sync with connection config

type SteampipeConfig

type SteampipeConfig struct {
	// map of connection name to partially parsed connection config
	Connections map[string]*modconfig.Connection

	// Steampipe options
	DefaultConnectionOptions *options.Connection
	DatabaseOptions          *options.Database
	TerminalOptions          *options.Terminal
	GeneralOptions           *options.General
	// contains filtered or unexported fields
}

SteampipeConfig :: Connection map and Steampipe settings

var Config *SteampipeConfig

func LoadSteampipeConfig added in v0.4.0

func LoadSteampipeConfig(workspacePath string, commandName string) (*SteampipeConfig, error)

LoadSteampipeConfig :: load the HCL config and parse into the global Config variable

func (*SteampipeConfig) ConfigMap

func (c *SteampipeConfig) ConfigMap() map[string]interface{}

ConfigMap :: create a config map to pass to viper

func (*SteampipeConfig) GetConnectionOptions

func (c *SteampipeConfig) GetConnectionOptions(connectionName string) *options.Connection

func (*SteampipeConfig) SetOptions

func (c *SteampipeConfig) SetOptions(opts options.Options)

func (*SteampipeConfig) String added in v0.4.0

func (c *SteampipeConfig) String() string

func (*SteampipeConfig) Validate added in v0.7.0

func (c *SteampipeConfig) Validate() error

type ValidationFailure

type ValidationFailure struct {
	Plugin             string
	ConnectionName     string
	Message            string
	ShouldDropIfExists bool
}

func (ValidationFailure) String

func (v ValidationFailure) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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