registry

package
v0.13.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2021 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloudQueryRegistryURl = "https://firestore.googleapis.com/v1/projects/hub-cloudquery/databases/(default)/documents/orgs/%s/providers/%s"
)

Variables

This section is empty.

Functions

func GetBinarySuffix

func GetBinarySuffix() string

func ParseProviderName added in v0.13.4

func ParseProviderName(name string) (string, string, error)

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>

Types

type Hub

type Hub struct {
	// Optional: if this flag is true, plugins downloaded from URL won't be verified when downloaded
	NoVerify bool
	// 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 NewRegistryHub(url string, opts ...Option) *Hub

func (Hub) Cleanup

func (h Hub) Cleanup() error

Cleanup removes all unused plugins from the plugin directory

func (Hub) GetProvider

func (h Hub) GetProvider(ctx context.Context, organization, providerName, providerVersion string) (ProviderDetails, error)

func (Hub) VerifyProvider

func (h Hub) VerifyProvider(ctx context.Context, organization, providerName, version string) bool

type Option

type Option func(h *Hub)

type ProviderDetails

type ProviderDetails struct {
	Name         string
	Version      string
	Organization string
	FilePath     string
}

type Registry

type Registry interface {
	VerifyProvider(ctx context.Context, organization, providerName, version string) bool
	GetProvider(ctx context.Context, organization, providerName, providerVersion string) (ProviderDetails, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL