Documentation
¶
Index ¶
- type Client
- func (c Client) Close()
- func (c Client) ExecutePolicy(ctx context.Context, request ExecutePolicyRequest) (*PolicyExecutionResult, 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) Initialize(ctx context.Context) error
- type ExecutePolicyRequest
- type FetchDoneResult
- type FetchRequest
- type FetchUpdate
- type FetchUpdateCallback
- type Option
- type PolicyExecutionCallback
- type PolicyExecutionResult
- type PolicyResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// 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.Registry
// manager manages all plugins lifecycle
Manager *plugin.Manager
// contains filtered or unexported fields
}
Client is the client for executing providers, fetching data and running queries and polices
func (Client) ExecutePolicy ¶
func (c Client) ExecutePolicy(ctx context.Context, request ExecutePolicyRequest) (*PolicyExecutionResult, error)
func (Client) GetProviderConfiguration ¶
func (Client) GetProviderSchema ¶
type ExecutePolicyRequest ¶
type ExecutePolicyRequest struct {
// Path to the policy, currently we still use the old .yml format, future versions will change to HCL
PolicyPath string
// UpdateCallback allows gets called when the client receives updates on policy execution.
UpdateCallback PolicyExecutionCallback
// if True policy execution will stop on first failure
StopOnFailure bool
// Path to save policy result
OutputPath string
}
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
}
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 PolicyExecutionCallback ¶
type PolicyExecutionResult ¶
type PolicyExecutionResult struct {
// True if all policies have passed
Passed bool
// Map of all query result sets
Results map[string]*PolicyResult
}
type PolicyResult ¶
Click to show internal directories.
Click to hide internal directories.