Documentation
¶
Index ¶
- func EnsureSessionData(ctx context.Context, source *SessionDataSource, ...) (err error, warnings []string)
- func LoadResourceNames(workspacePath string) (*modconfig.WorkspaceResources, error)
- type SessionDataSource
- type Workspace
- func (w *Workspace) CheckRequiredPluginsInstalled() error
- func (w *Workspace) Close()
- func (w *Workspace) GetControl(controlName string) (*modconfig.Control, bool)
- func (w *Workspace) GetQueriesFromArgs(args []string) ([]string, *modconfig.WorkspaceResourceMaps, error)
- func (w *Workspace) GetQuery(queryName string) (*modconfig.Query, bool)
- func (w *Workspace) GetResourceMaps() *modconfig.WorkspaceResourceMaps
- func (w *Workspace) PublishReportEvent(e reportevents.ReportEvent)
- func (w *Workspace) RegisterReportEventHandler(handler reportevents.ReportEventHandler)
- func (w *Workspace) ResolveControlQuery(control *modconfig.Control, args *modconfig.QueryArgs) (string, error)
- func (w *Workspace) ResolveQueryAndArgs(sqlString string) (string, modconfig.QueryProvider, error)
- func (w *Workspace) SetOnFileWatcherEventMessages(f func())
- func (w *Workspace) SetupWatcher(ctx context.Context, client db_common.Client, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureSessionData ¶ added in v0.8.3
func EnsureSessionData(ctx context.Context, source *SessionDataSource, session *db_common.DatabaseSession) (err error, warnings []string)
EnsureSessionData determines whether session scoped data (introspection tables and prepared statements) exists for this session, and if not, creates it
func LoadResourceNames ¶ added in v0.8.0
func LoadResourceNames(workspacePath string) (*modconfig.WorkspaceResources, error)
LoadResourceNames builds lists of all workspace resource names
Types ¶
type SessionDataSource ¶ added in v0.8.3
type SessionDataSource struct {
PreparedStatementSource func() *modconfig.WorkspaceResourceMaps
IntrospectionTableSource func() *modconfig.WorkspaceResourceMaps
}
func NewSessionDataSource ¶ added in v0.8.3
func NewSessionDataSource(w *Workspace, preparedStatementSource *modconfig.WorkspaceResourceMaps) *SessionDataSource
type Workspace ¶
type Workspace struct {
Path string
ModInstallationPath string
Mod *modconfig.Mod
Queries map[string]*modconfig.Query
Controls map[string]*modconfig.Control
Benchmarks map[string]*modconfig.Benchmark
Mods map[string]*modconfig.Mod
Reports map[string]*modconfig.ReportContainer
ReportContainers map[string]*modconfig.ReportContainer
ReportCharts map[string]*modconfig.ReportChart
ReportCounters map[string]*modconfig.ReportCounter
ReportHierarchies map[string]*modconfig.ReportHierarchy
ReportImages map[string]*modconfig.ReportImage
ReportInputs map[string]*modconfig.ReportInput
ReportTables map[string]*modconfig.ReportTable
ReportTexts map[string]*modconfig.ReportText
Variables map[string]*modconfig.Variable
//local resources keyed by unqualifed name
LocalQueries map[string]*modconfig.Query
LocalControls map[string]*modconfig.Control
LocalBenchmarks map[string]*modconfig.Benchmark
// contains filtered or unexported fields
}
func (*Workspace) CheckRequiredPluginsInstalled ¶ added in v0.6.0
func (*Workspace) GetControl ¶ added in v0.6.1
func (*Workspace) GetQueriesFromArgs ¶ added in v0.8.0
func (w *Workspace) GetQueriesFromArgs(args []string) ([]string, *modconfig.WorkspaceResourceMaps, error)
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) GetResourceMaps ¶ added in v0.5.0
func (w *Workspace) GetResourceMaps() *modconfig.WorkspaceResourceMaps
GetResourceMaps implements ResourceMapsProvider
func (*Workspace) PublishReportEvent ¶ added in v0.7.1
func (w *Workspace) PublishReportEvent(e reportevents.ReportEvent)
func (*Workspace) RegisterReportEventHandler ¶ added in v0.7.1
func (w *Workspace) RegisterReportEventHandler(handler reportevents.ReportEventHandler)
func (*Workspace) ResolveControlQuery ¶ added in v0.8.0
func (w *Workspace) ResolveControlQuery(control *modconfig.Control, args *modconfig.QueryArgs) (string, error)
ResolveControlQuery resolves the query for the given Control
func (*Workspace) ResolveQueryAndArgs ¶ added in v0.8.0
ResolveQueryAndArgs attempts to resolve 'arg' to a query and query args
func (*Workspace) SetOnFileWatcherEventMessages ¶ added in v0.10.0
func (w *Workspace) SetOnFileWatcherEventMessages(f func())
Click to show internal directories.
Click to hide internal directories.