Documentation
¶
Index ¶
- Variables
- func FindModFilePath(folder string) (string, error)
- func GetWorkspaceResourcesOfType[T modconfig.HclResource](w *Workspace) map[string]T
- func HomeDirectoryModfileCheck(ctx context.Context, workspacePath string) error
- func LoadResourceNames(ctx context.Context, workspacePath string) (*modconfig.WorkspaceResources, error)
- func LoadVariables(ctx context.Context, workspacePath string, fileInclusions ...string) ([]*modconfig.Variable, *error_helpers.ErrorAndWarnings)
- type Workspace
- func Load(ctx context.Context, workspacePath string) (*Workspace, *error_helpers.ErrorAndWarnings)
- func LoadWithParams(ctx context.Context, workspacePath string, ...) (*Workspace, *error_helpers.ErrorAndWarnings)
- func LoadWorkspacePromptingForVariables(ctx context.Context, workspacePath string, ...) (*Workspace, *error_helpers.ErrorAndWarnings)
- 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) 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, errorHandler func(context.Context, error)) error
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 FindModFilePath ¶
FindModFilePath search up the directory tree to find the modfile
func GetWorkspaceResourcesOfType ¶
func GetWorkspaceResourcesOfType[T modconfig.HclResource](w *Workspace) map[string]T
GetWorkspaceResourcesOfType returns all resources of type T from a workspace
func LoadResourceNames ¶
func LoadResourceNames(ctx context.Context, workspacePath string) (*modconfig.WorkspaceResources, error)
LoadResourceNames builds lists of all workspace resource names
func LoadVariables ¶
func LoadVariables(ctx context.Context, workspacePath string, fileInclusions ...string) ([]*modconfig.Variable, *error_helpers.ErrorAndWarnings)
LoadVariables creates a Workspace and uses it to load all variables, ignoring any value resolution errors this is use for the variable list command
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 // Credentials are something different, it's not part of the mod, it's not part of the workspace, it is at the same level // with mod and workspace. However it can be reference by the mod, so it needs to be in the parse context Credentials map[string]modconfig.Credential 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 // should we load/watch files recursively ListFlag filehelpers.ListFlag FileInclusions []string // hooks OnFileWatcherError func(context.Context, error) OnFileWatcherEvent func(context.Context, *modconfig.ResourceMaps, *modconfig.ResourceMaps) // contains filtered or unexported fields }
func Load ¶
func Load(ctx context.Context, workspacePath string) (*Workspace, *error_helpers.ErrorAndWarnings)
Load creates a Workspace and loads the workspace mod
func LoadWithParams ¶
func LoadWithParams(ctx context.Context, workspacePath string, credentials map[string]modconfig.Credential, fileInclusions ...string) (*Workspace, *error_helpers.ErrorAndWarnings)
func LoadWorkspacePromptingForVariables ¶
func LoadWorkspacePromptingForVariables(ctx context.Context, workspacePath string, credentials map[string]modconfig.Credential, fileInclusions ...string) (*Workspace, *error_helpers.ErrorAndWarnings)
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 ¶
func (w *Workspace) GetQueryProvider(queryName string) (modconfig.QueryProvider, bool)
func (*Workspace) GetResource ¶
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) 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())