Documentation ¶
Index ¶
- Variables
- func EnsureSessionData(ctx context.Context, source *modconfig.ResourceMaps, conn *pgx.Conn) error
- func LoadResourceNames(ctx context.Context, workspacePath string) (*modconfig.WorkspaceResources, error)
- func LoadVariables(ctx context.Context, workspacePath string) ([]*modconfig.Variable, error)
- type Workspace
- func (w *Workspace) CheckRequiredPluginsInstalled() error
- func (w *Workspace) Close()
- func (w *Workspace) GetQueriesFromArgs(args []string) (map[string]*modconfig.ResolvedQuery, error)
- func (w *Workspace) GetQueryProvider(queryName string) (modconfig.QueryProvider, bool)
- func (w *Workspace) GetResource(parsedName *modconfig.ParsedResourceName) (resource modconfig.HclResource, found bool)
- func (w *Workspace) GetResourceMaps() *modconfig.ResourceMaps
- func (w *Workspace) ModfileExists() bool
- func (w *Workspace) PublishDashboardEvent(ctx context.Context, e dashboardevents.DashboardEvent)
- func (w *Workspace) RegisterDashboardEventHandler(ctx context.Context, handler dashboardevents.DashboardEventHandler)
- func (w *Workspace) ResolveQueryAndArgsFromSQLString(sqlString string) (*modconfig.ResolvedQuery, modconfig.QueryProvider, error)
- func (w *Workspace) ResolveQueryFromQueryProvider(queryProvider modconfig.QueryProvider, runtimeArgs *modconfig.QueryArgs) (*modconfig.ResolvedQuery, error)
- func (w *Workspace) SetOnFileWatcherEventMessages(f func())
- func (w *Workspace) SetupWatcher(ctx context.Context, client db_common.Client, ...) error
- func (w *Workspace) UnregisterDashboardEventHandlers()
Constants ¶
This section is empty.
Variables ¶
var (
ErrorNoModDefinition = fmt.Errorf("This command requires a mod definition file (mod.sp) - could not find in the current directory tree.\n\nYou can either clone a mod repository or install a mod using %s and run this command from the cloned/installed mod directory.\nPlease refer to: https://steampipe.io/docs/mods/overview", constants.Bold("steampipe mod install"))
)
var EventCount int64 = 0
Functions ¶
func EnsureSessionData ¶
func EnsureSessionData(ctx context.Context, source *modconfig.ResourceMaps, conn *pgx.Conn) error
EnsureSessionData determines whether introspection tables exists for this session, and if not, creates them if needed
func LoadResourceNames ¶
func LoadResourceNames(ctx context.Context, workspacePath string) (*modconfig.WorkspaceResources, error)
LoadResourceNames builds lists of all workspace resource names
Types ¶
type Workspace ¶
type Workspace struct { Path string ModInstallationPath string Mod *modconfig.Mod Mods map[string]*modconfig.Mod // the input variables used in the parse VariableValues map[string]string CloudMetadata *steampipeconfig.CloudMetadata // source snapshot paths // if this is set, no other mod resources are loaded and // the ResourceMaps returned by GetModResources will contain only the snapshots SourceSnapshots []string // contains filtered or unexported fields }
func LoadWorkspacePromptingForVariables ¶ added in v0.17.0
func LoadWorkspacePromptingForVariables(ctx context.Context) (*Workspace, *modconfig.ErrorAndWarnings)
func (*Workspace) CheckRequiredPluginsInstalled ¶
func (*Workspace) GetQueriesFromArgs ¶
GetQueriesFromArgs retrieves queries from args
For each arg check if it is a named query or a file, before falling back to treating it as sql
func (*Workspace) GetQueryProvider ¶ added in v0.17.0
func (w *Workspace) GetQueryProvider(queryName string) (modconfig.QueryProvider, bool)
func (*Workspace) GetResource ¶ added in v0.19.0
func (w *Workspace) GetResource(parsedName *modconfig.ParsedResourceName) (resource modconfig.HclResource, found bool)
func (*Workspace) GetResourceMaps ¶
func (w *Workspace) GetResourceMaps() *modconfig.ResourceMaps
GetResourceMaps implements ResourceMapsProvider
func (*Workspace) ModfileExists ¶
func (*Workspace) PublishDashboardEvent ¶
func (w *Workspace) PublishDashboardEvent(ctx context.Context, e dashboardevents.DashboardEvent)
func (*Workspace) RegisterDashboardEventHandler ¶
func (w *Workspace) RegisterDashboardEventHandler(ctx context.Context, handler dashboardevents.DashboardEventHandler)
RegisterDashboardEventHandler starts the event handler goroutine if necessary and adds the event handler to our list
func (*Workspace) ResolveQueryAndArgsFromSQLString ¶
func (w *Workspace) ResolveQueryAndArgsFromSQLString(sqlString string) (*modconfig.ResolvedQuery, modconfig.QueryProvider, error)
ResolveQueryAndArgsFromSQLString attempts to resolve 'arg' to a query and query args
func (*Workspace) ResolveQueryFromQueryProvider ¶
func (w *Workspace) ResolveQueryFromQueryProvider(queryProvider modconfig.QueryProvider, runtimeArgs *modconfig.QueryArgs) (*modconfig.ResolvedQuery, error)
ResolveQueryFromQueryProvider resolves the query for the given QueryProvider
func (*Workspace) SetOnFileWatcherEventMessages ¶
func (w *Workspace) SetOnFileWatcherEventMessages(f func())
func (*Workspace) SetupWatcher ¶
func (*Workspace) UnregisterDashboardEventHandlers ¶ added in v0.17.0
func (w *Workspace) UnregisterDashboardEventHandlers()
UnregisterDashboardEventHandlers clears all event handlers used when generating multiple snapshots