Documentation ¶
Overview ¶
Package registry is a generated GoMock package.
nolint: staticcheck
Index ¶
- Constants
- func GetBinarySuffix() string
- func ParseProviderName(name string) (org string, providerName string, err error)
- func ProviderRepoName(name string) string
- type Hub
- type MockRegistry
- func (m *MockRegistry) CheckUpdate(arg0 context.Context, arg1 Provider) (string, error)
- func (m *MockRegistry) Download(arg0 context.Context, arg1 Provider, arg2 bool) (ProviderBinary, error)
- func (m *MockRegistry) EXPECT() *MockRegistryMockRecorder
- func (m *MockRegistry) Get(arg0, arg1 string) (ProviderBinary, error)
- type MockRegistryMockRecorder
- type Option
- type Provider
- type ProviderBinary
- type Providers
- type Registry
Constants ¶
const (
DefaultOrganization = "cloudquery"
)
const LatestVersion = "latest"
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 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 // contains filtered or unexported fields }
func NewRegistryHub ¶
func (Hub) CheckUpdate ¶ added in v0.23.0
CheckUpdate 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".
type MockRegistry ¶ added in v0.23.0
type MockRegistry struct {
// contains filtered or unexported fields
}
MockRegistry is a mock of Registry interface.
func NewMockRegistry ¶ added in v0.23.0
func NewMockRegistry(ctrl *gomock.Controller) *MockRegistry
NewMockRegistry creates a new mock instance.
func (*MockRegistry) CheckUpdate ¶ added in v0.23.0
CheckUpdate mocks base method.
func (*MockRegistry) Download ¶ added in v0.23.0
func (m *MockRegistry) Download(arg0 context.Context, arg1 Provider, arg2 bool) (ProviderBinary, error)
Download mocks base method.
func (*MockRegistry) EXPECT ¶ added in v0.23.0
func (m *MockRegistry) EXPECT() *MockRegistryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRegistry) Get ¶ added in v0.23.0
func (m *MockRegistry) Get(arg0, arg1 string) (ProviderBinary, error)
Get mocks base method.
type MockRegistryMockRecorder ¶ added in v0.23.0
type MockRegistryMockRecorder struct {
// contains filtered or unexported fields
}
MockRegistryMockRecorder is the mock recorder for MockRegistry.
func (*MockRegistryMockRecorder) CheckUpdate ¶ added in v0.23.0
func (mr *MockRegistryMockRecorder) CheckUpdate(arg0, arg1 interface{}) *gomock.Call
CheckUpdate indicates an expected call of CheckUpdate.
func (*MockRegistryMockRecorder) Download ¶ added in v0.23.0
func (mr *MockRegistryMockRecorder) Download(arg0, arg1, arg2 interface{}) *gomock.Call
Download indicates an expected call of Download.
func (*MockRegistryMockRecorder) Get ¶ added in v0.23.0
func (mr *MockRegistryMockRecorder) Get(arg0, arg1 interface{}) *gomock.Call
Get indicates an expected call of Get.
type Option ¶
type Option func(h *Hub)
func WithPluginDirectory ¶ added in v0.23.0
func WithProgress ¶ added in v0.23.0
type Provider ¶ added in v0.23.0
type ProviderBinary ¶ added in v0.23.0
type Registry ¶
type Registry interface { // Get returns a loaded provider from the hub without downloading it again, returns an error if not found Get(providerName, providerVersion string) (ProviderBinary, error) // CheckUpdate checks if there is an update available for the requested provider. CheckUpdate(ctx context.Context, provider Provider) (string, error) // Download downloads a single provider from remote source. Download(ctx context.Context, provider Provider, noVerify bool) (ProviderBinary, error) }