Documentation ¶
Index ¶
- Constants
- func CleanupOldTmpDirs(ctx context.Context)
- func Exists(ctx context.Context, plugin string) (bool, error)
- func GetAllUpdateReport(ctx context.Context, installationID string, ...) map[string]PluginVersionCheckReport
- func GetUpdateReport(ctx context.Context, installationID string, ...) map[string]PluginVersionCheckReport
- func PrintInstallReports(reports PluginInstallReports, isUpdateReport bool)
- func ResolvePluginImageRef(pluginAlias string) string
- func UpdateRequired(report PluginVersionCheckReport) bool
- type Plugin
- func (l *Plugin) Equals(other *Plugin) bool
- func (l *Plugin) FriendlyName() string
- func (l *Plugin) GetLimiterMap() map[string]*RateLimiter
- func (l *Plugin) GetMaxMemoryBytes() int64
- func (l *Plugin) GetStartTimeout() int64
- func (l *Plugin) IsDefault() bool
- func (l *Plugin) OnDecoded(block *hcl.Block)
- type PluginInstallReport
- type PluginInstallReports
- type PluginVersion
- type PluginVersionCheckReport
- type PluginVersionMap
- type PluginVersionString
- type RateLimiter
- type ResolvedPluginVersion
- type VersionChecker
Constants ¶
const ( LimiterSourceConfig = "config" LimiterSourcePlugin = "plugin" LimiterStatusActive = "active" LimiterStatusOverridden = "overridden" )
const ( VersionCheckerSchema = "https" VersionCheckerHost = "hub.steampipe.io" VersionCheckerEndpoint = "api/plugin/version" )
Variables ¶
This section is empty.
Functions ¶
func CleanupOldTmpDirs ¶
func GetAllUpdateReport ¶
func GetAllUpdateReport(ctx context.Context, installationID string, pluginVersions map[string]*versionfile.InstalledVersion) map[string]PluginVersionCheckReport
GetAllUpdateReport looks up and reports the updated version of all turbot plugins which are listed in versions.json
func GetUpdateReport ¶
func GetUpdateReport(ctx context.Context, installationID string, check []*versionfile.InstalledVersion) map[string]PluginVersionCheckReport
GetUpdateReport looks up and reports the updated version of selective turbot plugins which are listed in versions.json
func PrintInstallReports ¶
func PrintInstallReports(reports PluginInstallReports, isUpdateReport bool)
PrintInstallReports Prints out the installation reports onto the console
func ResolvePluginImageRef ¶
ResolvePluginImageRef resolves the plugin image ref from the plugin alias (this handles the special case of locally developed plugins in the plugins/local folder)
func UpdateRequired ¶
func UpdateRequired(report PluginVersionCheckReport) bool
UpdateRequired determines if the latest version in a "stream" requires the plugin to update.
Types ¶
type Plugin ¶
type Plugin struct { Instance string `hcl:"name,label" db:"plugin_instance"` Alias string `hcl:"source,optional"` MemoryMaxMb *int `hcl:"memory_max_mb,optional" db:"memory_max_mb"` StartTimeout *int `hcl:"start_timeout,optional"` Limiters []*RateLimiter `hcl:"limiter,block" db:"limiters"` FileName *string `db:"file_name"` StartLineNumber *int `db:"start_line_number"` EndLineNumber *int `db:"end_line_number"` // the image ref as a string Plugin string `db:"plugin"` // the actual plugin version, as a string Version string `db:"version"` }
func NewImplicitPlugin ¶
NewImplicitPlugin creates a default plugin config struct for a connection this is called when there is no explicit plugin config defined for a plugin which is used by a connection
func (*Plugin) FriendlyName ¶
func (*Plugin) GetLimiterMap ¶
func (l *Plugin) GetLimiterMap() map[string]*RateLimiter
func (*Plugin) GetMaxMemoryBytes ¶
func (*Plugin) GetStartTimeout ¶
type PluginInstallReport ¶
type PluginInstallReport struct { Skipped bool Plugin string SkipReason string DocURL string Version string IsUpdateReport bool }
func (*PluginInstallReport) String ¶
func (i *PluginInstallReport) String() string
type PluginInstallReports ¶
type PluginInstallReports []*PluginInstallReport
func (PluginInstallReports) Len ¶
func (i PluginInstallReports) Len() int
making the type compatible with sort.Interface so that we can use the sort package utilities
func (PluginInstallReports) Less ¶
func (i PluginInstallReports) Less(lIdx, rIdx int) bool
func (PluginInstallReports) Swap ¶
func (i PluginInstallReports) Swap(lIdx, rIdx int)
type PluginVersion ¶
type PluginVersion struct { // the plugin name, as specified in the mod requires block. , e.g. turbot/mod1, aws RawName string `cty:"name" hcl:"name,label"` // the minumum version which satisfies the requirement MinVersionString string `cty:"min_version" hcl:"min_version,optional"` Constraint *semver.Constraints // the org and name which are parsed from the raw name Org string Name string DeclRange hcl.Range }
func (*PluginVersion) FullName ¶
func (p *PluginVersion) FullName() string
func (*PluginVersion) Initialise ¶
func (p *PluginVersion) Initialise(block *hcl.Block) hcl.Diagnostics
Initialise parses the version and name properties
func (*PluginVersion) ShortName ¶
func (p *PluginVersion) ShortName() string
func (*PluginVersion) String ¶
func (p *PluginVersion) String() string
type PluginVersionCheckReport ¶
type PluginVersionCheckReport struct { Plugin *versionfile.InstalledVersion CheckResponse versionCheckCorePayload CheckRequest versionCheckCorePayload }
PluginVersionCheckReport
func (*PluginVersionCheckReport) ShortName ¶
func (vr *PluginVersionCheckReport) ShortName() string
func (*PluginVersionCheckReport) ShortNameWithConstraint ¶
func (vr *PluginVersionCheckReport) ShortNameWithConstraint() string
type PluginVersionMap ¶
type PluginVersionMap struct { Backend string Database string AvailablePlugins map[string]*PluginVersionString }
func NewPluginVersionMap ¶
func NewPluginVersionMap(backend, database string, availablePlugins map[string]*PluginVersionString) *PluginVersionMap
type PluginVersionString ¶
type PluginVersionString struct {
// contains filtered or unexported fields
}
func LocalPluginVersionString ¶
func LocalPluginVersionString() *PluginVersionString
func NewPluginVersionString ¶
func NewPluginVersionString(version string) (*PluginVersionString, error)
func (*PluginVersionString) IsLocal ¶
func (p *PluginVersionString) IsLocal() bool
func (*PluginVersionString) IsSemver ¶
func (p *PluginVersionString) IsSemver() bool
func (*PluginVersionString) Semver ¶
func (p *PluginVersionString) Semver() *semver.Version
func (*PluginVersionString) String ¶
func (p *PluginVersionString) String() string
type RateLimiter ¶
type RateLimiter struct { Name string `hcl:"name,label" db:"name"` BucketSize *int64 `hcl:"bucket_size,optional" db:"bucket_size"` FillRate *float32 `hcl:"fill_rate,optional" db:"fill_rate"` MaxConcurrency *int64 `hcl:"max_concurrency,optional" db:"max_concurrency"` Scope []string `hcl:"scope,optional" db:"scope"` Where *string `hcl:"where,optional" db:"where"` Plugin string `db:"plugin"` PluginInstance string `db:"plugin_instance"` FileName *string `db:"file_name" json:"-"` StartLineNumber *int `db:"start_line_number" json:"-"` EndLineNumber *int `db:"end_line_number" json:"-"` Status string `db:"status"` Source string `db:"source_type"` ImageRef *ociinstaller.ImageRef `db:"-" json:"-"` }
func (*RateLimiter) Equals ¶
func (l *RateLimiter) Equals(other *RateLimiter) bool
func (*RateLimiter) OnDecoded ¶
func (l *RateLimiter) OnDecoded(block *hcl.Block)
func (*RateLimiter) SetPlugin ¶
func (l *RateLimiter) SetPlugin(plugin *Plugin)
func (*RateLimiter) SetPluginImageRef ¶
func (l *RateLimiter) SetPluginImageRef(alias string)
type ResolvedPluginVersion ¶
func NewResolvedPluginVersion ¶
func NewResolvedPluginVersion(pluginName string, version string, constraint string) ResolvedPluginVersion
func (ResolvedPluginVersion) GetVersionTag ¶
func (r ResolvedPluginVersion) GetVersionTag() string
GetVersionTag returns the <PluginName>:<Version> (turbot/chaos:0.4.1)
type VersionChecker ¶
type VersionChecker struct {
// contains filtered or unexported fields
}
VersionChecker :: wrapper struct over the plugin version check utilities