utils

package
v1.0.49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEveryConfiguredGcpAccess

func ForEveryConfiguredGcpAccess(
	supplier func(access *GcpAccess, ctx context.Context) ([]discovery_kit_api.Target, error),
	ctx context.Context,
	discovery string,
) ([]discovery_kit_api.Target, error)

ForEveryConfiguredGcpAccess fans the supplier out across all configured projects using config.WorkerThreads goroutines. Errors from the supplier are logged per-project and do not abort the overall discovery.

func InitializeGcpAccess

func InitializeGcpAccess(spec config.Specification)

InitializeGcpAccess builds one GcpAccess per configured project. Must be called once after config.ValidateConfiguration. Projects whose client options fail to build are logged and skipped; the extension continues to operate with the remaining projects.

func SetProjectsForTest

func SetProjectsForTest(entries map[string]GcpAccess)

SetProjectsForTest replaces the internal projects map. Intended for tests only.

Types

type GcpAccess

type GcpAccess struct {
	ProjectID     string
	ClientOptions []option.ClientOption
}

GcpAccess represents the configured access to a single GCP project, including any pre-built client options required to authenticate (impersonation token sources or keyfile credentials).

func GetGcpAccess

func GetGcpAccess(projectID string) (*GcpAccess, error)

GetGcpAccess returns the access entry for the given project ID, or an error if none is configured.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL