Documentation
¶
Index ¶
- Constants
- type CQPlugin
- type CQProvider
- type CQProviderServer
- type ConfigureProviderRequest
- type ConfigureProviderResponse
- type ConnectionDetails
- type FailedResourceFetch
- type FetchResourcesRequest
- type FetchResourcesResponse
- type FetchResourcesSender
- type FetchResourcesStream
- type GRPCClient
- func (g GRPCClient) ConfigureProvider(ctx context.Context, request *ConfigureProviderRequest) (*ConfigureProviderResponse, error)
- func (g GRPCClient) FetchResources(ctx context.Context, request *FetchResourcesRequest) (FetchResourcesStream, error)
- func (g GRPCClient) GetModuleInfo(ctx context.Context, request *GetModuleRequest) (*GetModuleResponse, error)
- func (g GRPCClient) GetProviderConfig(ctx context.Context, _ *GetProviderConfigRequest) (*GetProviderConfigResponse, error)
- func (g GRPCClient) GetProviderSchema(ctx context.Context, _ *GetProviderSchemaRequest) (*GetProviderSchemaResponse, error)
- type GRPCFetchResourcesServer
- type GRPCFetchResponseStream
- type GRPCServer
- func (g *GRPCServer) ConfigureProvider(ctx context.Context, request *internal.ConfigureProvider_Request) (*internal.ConfigureProvider_Response, error)
- func (g *GRPCServer) FetchResources(request *internal.FetchResources_Request, ...) error
- func (g *GRPCServer) GetModuleInfo(ctx context.Context, request *internal.GetModuleInfo_Request) (*internal.GetModuleInfo_Response, error)
- func (g *GRPCServer) GetProviderConfig(ctx context.Context, _ *internal.GetProviderConfig_Request) (*internal.GetProviderConfig_Response, error)
- func (g *GRPCServer) GetProviderSchema(ctx context.Context, _ *internal.GetProviderSchema_Request) (*internal.GetProviderSchema_Response, error)
- type GetModuleRequest
- type GetModuleResponse
- type GetProviderConfigRequest
- type GetProviderConfigResponse
- type GetProviderSchemaRequest
- type GetProviderSchemaResponse
- type ModuleFile
- type ModuleInfo
- type ProviderDiagnostic
- type ResourceFetchStatus
- type ResourceFetchSummary
Constants ¶
const ( V4 = 4 Vunmanaged = -1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CQPlugin ¶
type CQPlugin struct {
// GRPCPlugin must still implement the Stub interface
plugin.Plugin
// Concrete implementation, written in Go. This is only used for plugins
// that are written in Go.
Impl CQProviderServer
}
CQPlugin This is the implementation of plugin.GRPCServer so we can serve/consume this.
func (*CQPlugin) GRPCClient ¶
func (p *CQPlugin) GRPCClient(_ context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*CQPlugin) GRPCServer ¶
type CQProvider ¶
type CQProvider interface {
// GetProviderSchema is called when CloudQuery needs to know what the
// provider's tables and version
GetProviderSchema(context.Context, *GetProviderSchemaRequest) (*GetProviderSchemaResponse, error)
// GetProviderConfig is called when CloudQuery wants to generate a configuration example for a provider
GetProviderConfig(context.Context, *GetProviderConfigRequest) (*GetProviderConfigResponse, error)
// ConfigureProvider is called to pass the user-specified provider
// configuration to the provider.
ConfigureProvider(context.Context, *ConfigureProviderRequest) (*ConfigureProviderResponse, error)
// FetchResources is called when CloudQuery requests to fetch one or more resources from the provider.
// The provider reports back status updates on the resources fetching progress.
FetchResources(context.Context, *FetchResourcesRequest) (FetchResourcesStream, error)
// Gets info about specific module config embedded inside provider
GetModuleInfo(context.Context, *GetModuleRequest) (*GetModuleResponse, error)
}
type CQProviderServer ¶
type CQProviderServer interface {
// GetProviderSchema is called when CloudQuery needs to know what the
// provider's tables and version
GetProviderSchema(context.Context, *GetProviderSchemaRequest) (*GetProviderSchemaResponse, error)
// GetProviderConfig is called when CloudQuery wants to generate a configuration example for a provider
GetProviderConfig(context.Context, *GetProviderConfigRequest) (*GetProviderConfigResponse, error)
// ConfigureProvider is called to pass the user-specified provider
// configuration to the provider.
ConfigureProvider(context.Context, *ConfigureProviderRequest) (*ConfigureProviderResponse, error)
// FetchResources is called when CloudQuery requests to fetch one or more resources from the provider.
// The provider reports back status updates on the resources fetching progress.
FetchResources(context.Context, *FetchResourcesRequest, FetchResourcesSender) error
// Gets info about specific module config embedded inside provider
GetModuleInfo(context.Context, *GetModuleRequest) (*GetModuleResponse, error)
}
type ConfigureProviderRequest ¶
type ConfigureProviderRequest struct {
// CloudQueryVersion is the version of CloudQuery executing the request.
CloudQueryVersion string
// ConnectionDetails holds information regarding connection to the CloudQuery database
Connection ConnectionDetails
// Config is the configuration the user supplied for the provider
Config []byte
// Fields to inject to every resource on insert
ExtraFields map[string]interface{}
}
type ConfigureProviderResponse ¶
type ConfigureProviderResponse struct {
// Error should be set to a string describing the error.
// The error can be either from malformed configuration or failure to setup
Error string
}
type ConnectionDetails ¶
type FailedResourceFetch ¶ added in v0.5.0
type FetchResourcesRequest ¶
type FetchResourcesRequest struct {
// List of resources to fetch
Resources []string
// PartialFetchingEnabled if true enables partial fetching
PartialFetchingEnabled bool
// ParallelFetchingLimit limits parallel resources fetch at a time is more than 0
ParallelFetchingLimit uint64
// MaxGoroutines specified an approximate maximum number of goroutines that will be spanwd during fetch
MaxGoroutines uint64
// Timeout for each parent resource resolve call
Timeout time.Duration
// Metadata for the fetch
Metadata map[string]interface{}
}
FetchResourcesRequest represents a CloudQuery RPC request of one or more resources
type FetchResourcesResponse ¶
type FetchResourcesResponse struct {
ResourceName string
// map of resources that have finished fetching
FinishedResources map[string]bool
// Amount of resources collected so far
ResourceCount uint64
// Error value if any, if returned the stream will be canceled
Error string
// list of resources where the fetching failed
PartialFetchFailedResources []*FailedResourceFetch
// fetch summary of resource that finished execution
Summary ResourceFetchSummary
}
FetchResourcesResponse represents a CloudQuery RPC response of the current fetch progress of the provider
type FetchResourcesSender ¶
type FetchResourcesSender interface {
Send(*FetchResourcesResponse) error
}
FetchResourcesSender represents a CloudQuery RPC stream of fetch updates from the provider
type FetchResourcesStream ¶
type FetchResourcesStream interface {
Recv() (*FetchResourcesResponse, error)
}
FetchResourcesStream represents a CloudQuery RPC stream of fetch updates from the provider
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
func (GRPCClient) ConfigureProvider ¶
func (g GRPCClient) ConfigureProvider(ctx context.Context, request *ConfigureProviderRequest) (*ConfigureProviderResponse, error)
func (GRPCClient) FetchResources ¶
func (g GRPCClient) FetchResources(ctx context.Context, request *FetchResourcesRequest) (FetchResourcesStream, error)
func (GRPCClient) GetModuleInfo ¶ added in v0.8.1
func (g GRPCClient) GetModuleInfo(ctx context.Context, request *GetModuleRequest) (*GetModuleResponse, error)
func (GRPCClient) GetProviderConfig ¶
func (g GRPCClient) GetProviderConfig(ctx context.Context, _ *GetProviderConfigRequest) (*GetProviderConfigResponse, error)
func (GRPCClient) GetProviderSchema ¶
func (g GRPCClient) GetProviderSchema(ctx context.Context, _ *GetProviderSchemaRequest) (*GetProviderSchemaResponse, error)
type GRPCFetchResourcesServer ¶
type GRPCFetchResourcesServer struct {
// contains filtered or unexported fields
}
func (GRPCFetchResourcesServer) Send ¶
func (g GRPCFetchResourcesServer) Send(response *FetchResourcesResponse) error
type GRPCFetchResponseStream ¶
type GRPCFetchResponseStream struct {
// contains filtered or unexported fields
}
func (GRPCFetchResponseStream) Recv ¶
func (g GRPCFetchResponseStream) Recv() (*FetchResourcesResponse, error)
type GRPCServer ¶
type GRPCServer struct {
// This is the real implementation
Impl CQProviderServer
internal.UnimplementedProviderServer
}
func (*GRPCServer) ConfigureProvider ¶
func (g *GRPCServer) ConfigureProvider(ctx context.Context, request *internal.ConfigureProvider_Request) (*internal.ConfigureProvider_Response, error)
func (*GRPCServer) FetchResources ¶
func (g *GRPCServer) FetchResources(request *internal.FetchResources_Request, server internal.Provider_FetchResourcesServer) error
func (*GRPCServer) GetModuleInfo ¶ added in v0.8.1
func (g *GRPCServer) GetModuleInfo(ctx context.Context, request *internal.GetModuleInfo_Request) (*internal.GetModuleInfo_Response, error)
func (*GRPCServer) GetProviderConfig ¶
func (g *GRPCServer) GetProviderConfig(ctx context.Context, _ *internal.GetProviderConfig_Request) (*internal.GetProviderConfig_Response, error)
func (*GRPCServer) GetProviderSchema ¶
func (g *GRPCServer) GetProviderSchema(ctx context.Context, _ *internal.GetProviderSchema_Request) (*internal.GetProviderSchema_Response, error)
type GetModuleRequest ¶ added in v0.8.1
GetModuleRequest represents a CloudQuery RPC request of provider's module info for specific provider
type GetModuleResponse ¶ added in v0.8.1
type GetModuleResponse struct {
Data map[uint32]ModuleInfo // version vs Info
AvailableVersions []uint32 // all available versions, regardless of being requested in PreferredVersions or not
Diagnostics diag.Diagnostics
}
GetModuleResponse represents a CloudQuery RPC response of provider's module info for specific provider
type GetProviderConfigRequest ¶
type GetProviderConfigRequest struct{}
GetProviderConfigRequest represents a CloudQuery RPC request for provider's config
type GetProviderConfigResponse ¶
type GetProviderConfigResponse struct {
Config []byte
}
type GetProviderSchemaRequest ¶
type GetProviderSchemaRequest struct{}
GetProviderSchemaRequest represents a CloudQuery RPC request for provider's schemas
type GetProviderSchemaResponse ¶
type GetProviderSchemaResponse struct {
// Name is the name of the provider being executed
Name string
// Version is the current version provider being executed
Version string
// ResourceTables is a map of tables this provider creates
ResourceTables map[string]*schema.Table
// Migrations scripts available for the provider, for all dialects
Migrations map[string]map[string][]byte
}
type ModuleFile ¶ added in v0.8.1
ModuleFile is a file definition inside ModuleInfo
type ModuleInfo ¶ added in v0.8.1
type ModuleInfo struct {
Files []*ModuleFile
Extras map[string]string
}
ModuleInfo is info about a module
type ProviderDiagnostic ¶ added in v0.5.0
type ProviderDiagnostic struct {
ResourceName string
ResourceId []string
DiagnosticType diag.DiagnosticType
DiagnosticSeverity diag.Severity
Summary string
Details string
}
func (ProviderDiagnostic) Description ¶ added in v0.5.0
func (p ProviderDiagnostic) Description() diag.Description
func (ProviderDiagnostic) Error ¶ added in v0.5.5
func (p ProviderDiagnostic) Error() string
func (ProviderDiagnostic) Severity ¶ added in v0.5.0
func (p ProviderDiagnostic) Severity() diag.Severity
func (ProviderDiagnostic) Type ¶ added in v0.5.0
func (p ProviderDiagnostic) Type() diag.DiagnosticType
type ResourceFetchStatus ¶ added in v0.5.0
type ResourceFetchStatus int
ResourceFetchStatus defines execution status of the resource fetch execution
const ( // ResourceFetchComplete execution was completed successfully without any errors/diagnostics ResourceFetchComplete ResourceFetchStatus = iota // ResourceFetchFailed execution failed and wasn't able to fetch any resource ResourceFetchFailed // ResourceFetchPartial execution was partial, one or more resources failed to resolve/fetch ResourceFetchPartial // ResourceFetchCanceled execution was canceled preemptively ResourceFetchCanceled )
func (ResourceFetchStatus) String ¶ added in v0.8.0
func (s ResourceFetchStatus) String() string
type ResourceFetchSummary ¶ added in v0.5.0
type ResourceFetchSummary struct {
// Execution status of resource
Status ResourceFetchStatus
// Total Amount of resources collected by this resource
ResourceCount uint64
// Diagnostics of failed resource fetch, the diagnostic provides insights such as severity, summary and
// details on how to solve this issue
Diagnostics diag.Diagnostics
}
ResourceFetchSummary includes a summarized report of a fetched resource, such as total amount of resources collected, status of the fetch and any diagnostics found while executing fetch on it.