Documentation
¶
Overview ¶
nolint: staticcheck
Index ¶
- Constants
- func GetBinarySuffix() string
- func ParseProviderName(name string) (string, string, error)
- func ParseProviderNameWithVersion(nameWithVersion string) (string, string, string, error)
- func ProviderRepoName(name string) string
- type Hub
- func (h Hub) CheckProviderUpdate(ctx context.Context, requestedProvider *config.RequiredProvider) (string, error)
- func (h Hub) DownloadProvider(ctx context.Context, requestedProvider *config.RequiredProvider, noVerify bool) (ProviderDetails, error)
- func (h Hub) GetProvider(providerName, providerVersion string) (ProviderDetails, error)
- func (h Hub) VerifyProvider(ctx context.Context, organization, providerName, version string) bool
- type Option
- type ProviderDetails
Constants ¶
const (
CloudQueryRegistryURL = "https://firestore.googleapis.com/v1/projects/hub-cloudquery/databases/(default)/documents/orgs/%s/providers/%s"
)
const (
DefaultOrganization = "cloudquery"
)
Variables ¶
This section is empty.
Functions ¶
func GetBinarySuffix ¶
func GetBinarySuffix() string
func ParseProviderName ¶ added in v0.13.4
ParseProviderName parses a name of a provider which can be just a name or a name + organization For example aws <-> cloudquery/aws will download the cq-provider-aws in cloudquery organization The organization defaults to cloudquery, if you want to download from a different repo set the name <your_org_name>/<provider_name>
func ParseProviderNameWithVersion ¶ added in v0.21.0
ParseProviderNameWithVersion parses the given string as "repository/provider@version" or "provider@version" (or @version omitted, defaulting to "latest")
func ProviderRepoName ¶ added in v0.20.2
ProviderRepoName returns a repository name for a given provider name.
Types ¶
type Hub ¶
type Hub struct {
// Optional: Where to save downloaded providers, by default current working directory, defaults to ./cq/providers
PluginDirectory string
// Optional: Download propagator allows the creator to get called back on download progress and completion.
ProgressUpdater ui.Progress
// Optional: logger to use, if not defined global logger is used.
Logger hclog.Logger
// contains filtered or unexported fields
}
func NewRegistryHub ¶
func (Hub) CheckProviderUpdate ¶ added in v0.17.1
func (h Hub) CheckProviderUpdate(ctx context.Context, requestedProvider *config.RequiredProvider) (string, error)
CheckProviderUpdate checks if there is an update available for the requested provider. Returns a new version if there is one, otherwise empty string. Call will be cancelled either if ctx is cancelled or after a timeout set by versionCheckHTTPTimeout. This function should not be called for a provider having Version set to "latest".
func (Hub) DownloadProvider ¶ added in v0.13.6
func (h Hub) DownloadProvider(ctx context.Context, requestedProvider *config.RequiredProvider, noVerify bool) (ProviderDetails, error)
func (Hub) GetProvider ¶
func (h Hub) GetProvider(providerName, providerVersion string) (ProviderDetails, error)
GetProvider returns a loaded provider from the hub without downloading it again, returns an error if not found.