Documentation
¶
Overview ¶
Package gcp implements the ports.GCPService interface using the Google Cloud Go SDK. This is the only package in the module that imports GCP SDK types.
Index ¶
- func New(ctx context.Context, projectID string, opts ...Option) (_ *gcpAdapter, retErr error)
- func NewDLPAdapter(ctx context.Context, log *slog.Logger) (*dlpAdapter, error)
- type ConfirmationRequiredError
- type CostAdapterConfig
- type CostSourceConfig
- type NotFoundError
- type Option
- func WithCallTimeout(d time.Duration) Option
- func WithClientOptions(opts ...option.ClientOption) Option
- func WithCostReasoning(cfg CostAdapterConfig) Option
- func WithCostReasoningSources(sources []CostSourceConfig) Option
- func WithGraphTimeout(d time.Duration) Option
- func WithLogger(l *slog.Logger) Option
- func WithModules(modules map[string]bool) Option
- func WithRateLimit(rps float64, burst int) Option
- func WithRecommender() Option
- func WithSecurityAudit(cfg SecurityAdapterConfig) Option
- func WithTraceBackend(backend string) Option
- type PermissionDeniedError
- type RetriableError
- type SecurityAdapterConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfirmationRequiredError ¶
type ConfirmationRequiredError = ports.ConfirmationRequiredError
ConfirmationRequiredError aliases ports.ConfirmationRequiredError for adapter-internal use.
type CostAdapterConfig ¶ added in v1.2.0
type CostAdapterConfig struct {
QueryProjectID string
ExportProjectID string
Dataset string
Table string
MaxBytesBilled int64
}
CostAdapterConfig identifies the Cloud Billing detailed export queried by the optional cost reasoning module. QueryProjectID owns the BigQuery jobs; ExportProjectID owns the export dataset.
type CostSourceConfig ¶ added in v1.2.1
type CostSourceConfig struct {
WorkloadProjectIDs []string
CostAdapterConfig
}
CostSourceConfig is the compiled runtime mapping between workload projects and one Cloud Billing detailed-export source. WorkloadProjectIDs must contain real configured project IDs, never user-facing aliases.
func NormalizeCostReasoningSources ¶ added in v1.2.1
func NormalizeCostReasoningSources(sources []CostSourceConfig, defaultProjectID string) ([]CostSourceConfig, error)
NormalizeCostReasoningSources validates compiled workload-project mappings and applies non-routing defaults. It returns an independent copy.
type NotFoundError ¶
type NotFoundError = ports.NotFoundError
NotFoundError aliases ports.NotFoundError for adapter-internal use.
type Option ¶
type Option func(*gcpAdapter)
Option configures a gcpAdapter created by New.
func WithCallTimeout ¶
WithCallTimeout sets the per-call context timeout applied inside every adapter method. Default: 30 seconds.
func WithClientOptions ¶
func WithClientOptions(opts ...option.ClientOption) Option
WithClientOptions passes extra google.golang.org/api/option.ClientOption values (e.g. WithEndpoint for emulator testing).
func WithCostReasoning ¶ added in v1.2.0
func WithCostReasoning(cfg CostAdapterConfig) Option
WithCostReasoning configures the optional Cloud Billing export reader.
func WithCostReasoningSources ¶ added in v1.2.1
func WithCostReasoningSources(sources []CostSourceConfig) Option
WithCostReasoningSources configures workload-project-specific Cloud Billing export sources. Selection is immutable after construction and safe for concurrent requests.
func WithGraphTimeout ¶
WithGraphTimeout sets the outer context timeout for graph exports and diagram discovery. Each individual sub-call still uses the per-call callTimeout (default 30s). Default: 120 seconds.
func WithLogger ¶
WithLogger sets the structured logger used by the adapter.
func WithModules ¶
WithModules restricts GCP client initialization to only the clients required by the named modules. A nil or empty map initializes all clients (default behavior).
func WithRateLimit ¶
WithRateLimit sets the token-bucket rate limiter. Default: 10 requests/second, burst 20.
func WithRecommender ¶
func WithRecommender() Option
WithRecommender enables the Cloud Recommender API integration used to enrich Aura Score efficiency signals with GCP's pre-computed idle / over-provisioned recommendations and their estimated monthly cost savings.
On by default. Set RECOMMENDER_ENABLED=false to disable. Requires the service account to have the Recommender Viewer role (or individual recommender.*.list permissions listed in the README).
func WithSecurityAudit ¶ added in v1.2.0
func WithSecurityAudit(cfg SecurityAdapterConfig) Option
func WithTraceBackend ¶
WithTraceBackend selects the backend used by gcp_trace_list_services. Valid values: "trace" (Cloud Trace v1 REST, default) or "monitoring" (Monitoring metric proxy).
type PermissionDeniedError ¶
type PermissionDeniedError = ports.PermissionDeniedError
PermissionDeniedError aliases ports.PermissionDeniedError for adapter-internal use.
type RetriableError ¶
type RetriableError = ports.RetriableError
RetriableError aliases ports.RetriableError for adapter-internal use.
type SecurityAdapterConfig ¶ added in v1.2.0
type SecurityAdapterConfig struct {
KubernetesAccess string
FleetProjectID string
ClusterConcurrency int
PerClusterTimeout time.Duration
MaxResourcesPerKind int
}
SecurityAdapterConfig controls bounded Kubernetes enrichment for the security posture collector.
Source Files
¶
- archgraph.go
- archgraph_view.go
- aura.go
- bigquery.go
- cache.go
- client.go
- cloudrun.go
- cloudsql.go
- cost_assets.go
- cost_billing.go
- cost_config.go
- cost_recommendations.go
- coverage.go
- datastores.go
- dlp.go
- errors.go
- eventarc.go
- functions.go
- gke.go
- gke_bottleneck.go
- gke_mesh.go
- gke_workloads.go
- iam.go
- k8s_client.go
- k8s_types.go
- logging.go
- modules.go
- monitoring.go
- networking.go
- pubsub.go
- recommender.go
- recommender_export.go
- recommender_quota.go
- regions.go
- retry.go
- scheduler.go
- secretmanager.go
- security.go
- security_firewall.go
- security_gke.go
- security_hierarchy.go
- serverlessgraph.go
- storage.go
- supplychain.go
- tagging.go
- tasks.go
- topology.go
- traces.go
- transport.go
- util.go
- vpcaccess.go
- workflows.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package resolution implements the edge-inference rules engine for the architecture graph.
|
Package resolution implements the edge-inference rules engine for the architecture graph. |