Documentation ¶
Index ¶
- Constants
- func BuildValidationWarningString(failures []*ValidationFailure) string
- func GetPluginPath(remoteSchema string) (string, error)
- func HandleGrpcError(err error, connection, call string) error
- func PluginFQNToSchemaName(pluginFQN string) string
- func SaveConnectionState(state ConnectionMap) error
- func ValidatePlugins(updates ConnectionMap, plugins []*ConnectionPlugin) ([]*ValidationFailure, ConnectionMap, []*ConnectionPlugin)
- type Connection
- type ConnectionData
- type ConnectionMap
- type ConnectionPlugin
- type ConnectionPluginInput
- type ConnectionUpdates
- type SteampipeConfig
- type ValidationFailure
Constants ¶
const CacheEnabledEnvVar = "STEAMPIPE_CACHE"
const CacheTTLEnvVar = "STEAMPIPE_CACHE_TTL"
Variables ¶
This section is empty.
Functions ¶
func BuildValidationWarningString ¶
func BuildValidationWarningString(failures []*ValidationFailure) string
func GetPluginPath ¶
func HandleGrpcError ¶
func PluginFQNToSchemaName ¶
schemas in postgres are limited to 63 chars - the FQN 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 Connection ¶
type Connection struct { // connection name Name string // FQN of plugin Plugin string // unparsed HCL of plugin specific connection config Config string // options Options *options.Connection }
Connection :: structure representing the partially parsed connection.
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 }
struct containing all details for a connection - the plugin name and checksum, the connection config and options
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
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]*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]*Connection // Steampipe options DefaultConnectionOptions *options.Connection DatabaseOptions *options.Database ConsoleOptions *options.Terminal GeneralOptions *options.General // array of options interfaces useful to build ConfigMap Options []options.Options }
SteampipeConfig :: Connection map and Steampipe settings
var Config *SteampipeConfig
func Load ¶
func Load() (*SteampipeConfig, error)
Load :: 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)
type ValidationFailure ¶
type ValidationFailure struct { Plugin string ConnectionName string Message string ShouldDropIfExists bool }
func (ValidationFailure) String ¶
func (v ValidationFailure) String() string