Documentation
¶
Index ¶
- type Client
- func (c *Client) BuildProviderTables(ctx context.Context, providerName string) error
- func (c Client) Close()
- func (c Client) DownloadPolicy(ctx context.Context, args []string) error
- func (c *Client) DownloadProviders(ctx context.Context) error
- func (c *Client) Fetch(ctx context.Context, request FetchRequest) error
- func (c Client) GetProviderConfiguration(ctx context.Context, providerName string) (*cqproto.GetProviderConfigResponse, error)
- func (c Client) GetProviderSchema(ctx context.Context, providerName string) (*cqproto.GetProviderSchemaResponse, error)
- func (c Client) RunPolicy(ctx context.Context, req PolicyRunRequest) error
- type FetchDoneResult
- type FetchRequest
- type FetchUpdate
- type FetchUpdateCallback
- type Option
- type PolicyRunRequest
- type TableCreator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// Required: List of providers that are required, these providers will be download if DownloadProviders is called.
Providers []*config.RequiredProvider
// Optional: Registry url to verify plugins from, defaults to CloudQuery hub
RegistryURL string
// Optional: Where to save downloaded providers, by default current working directory, defaults to ./cq/providers
PluginDirectory string
// Optional: Where to save downloaded policies, by default current working directory, defaults to ./cq/policy
PolicyDirectory string
// Optional: If true cloudquery just runs policy files without using git tag to select a version
SkipVersioning bool
// Optional: if this flag is true, plugins downloaded from URL won't be verified when downloaded
NoVerify bool
// Optional: DSN connection information for database client will connect to
DSN string
// Optional: Skips Building tables on fetch execution
SkipBuildTables bool
// Optional: HubProgressUpdater allows the client creator to get called back on download progress and completion.
HubProgressUpdater ui.Progress
// Optional: Logger framework can use to log.
// default: global logger provided.
Logger hclog.Logger
// Optional: Hub client to use to download plugins, the Hub is used to download and pluginManager providers binaries
// if not specified, default cloudquery registry is used.
Hub registry.Hub
// manager manages all plugins lifecycle
Manager *plugin.Manager
// TableCreator defines how table are created in the database
TableCreator TableCreator
// contains filtered or unexported fields
}
Client is the client for executing providers, fetching data and running queries and polices
func (*Client) BuildProviderTables ¶ added in v0.14.0
func (Client) DownloadPolicy ¶ added in v0.13.8
func (*Client) DownloadProviders ¶ added in v0.13.6
DownloadProviders downloads all provider binaries
func (Client) GetProviderConfiguration ¶
func (Client) GetProviderSchema ¶
type FetchDoneResult ¶
type FetchRequest ¶
type FetchRequest struct {
// UpdateCallback allows gets called when the client receives updates on fetch.
UpdateCallback FetchUpdateCallback
// Providers list of providers to call for fetching
Providers []*config.Provider
// Optional: Disable deletion of data from tables.
// Use this with caution, as it can create duplicates of data!
DisableDataDelete bool
// Optional: Adds extra fields to the provider, this is used for testing purposes.
ExtraFields map[string]interface{}
}
FetchRequest is provided to the Client to execute a fetch on one or more providers
type FetchUpdate ¶
type FetchUpdate struct {
Provider string
Version string
// Map of resources that have finished fetching
FinishedResources map[string]bool
// Amount of resources collected so far
ResourceCount uint64
// Error if any returned by the provider
Error string
}
func (FetchUpdate) AllDone ¶
func (f FetchUpdate) AllDone() bool
func (FetchUpdate) DoneCount ¶
func (f FetchUpdate) DoneCount() int
type FetchUpdateCallback ¶
type FetchUpdateCallback func(update FetchUpdate)
type PolicyRunRequest ¶ added in v0.13.8
type PolicyRunRequest struct {
// Args are the given arguments from the policy run command.
Args []string
// SubPath is the optional sub path for sub policy/query execution only.
SubPath string
// OutputPath is the output path for policy execution output.
OutputPath string
// StopOnFailure signals policy execution to stop after first failure.
StopOnFailure bool
// RunCallBack is the callback method that is called after every policy execution.
RunCallBack policy.ExecutionCallback
// SkipVersioning if true policy will be executed without checking out the version of the policy repo using git tags
SkipVersioning bool
}
PolicyRunRequest is the request used to run a policy.
Click to show internal directories.
Click to hide internal directories.