utils

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 7 Imported by: 0

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