common

package
v1.3.11 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 13 Imported by: 1 module, 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 AddAttribute

func AddAttribute(attribute map[string][]string, key string, value string)

func ConnectionAzure

func ConnectionAzure() (azcore.TokenCredential, error)

func DiscoverViaResourceGraph added in v1.3.0

func DiscoverViaResourceGraph(
	ctx context.Context,
	client ArmResourceGraphApi,
	query string,
	toTarget func(map[string]any) discovery_kit_api.Target,
) ([]discovery_kit_api.Target, error)

DiscoverViaResourceGraph runs an Azure Resource Graph query, iterates the result rows, and converts each map[string]any to a Target via toTarget. Returns an empty slice (not nil) on success with no rows so callers can safely range over the result.

The query is scoped to AZURE_SUBSCRIPTION_ID if that env var is set; with no env var, Resource Graph runs across every subscription the SP can see.

func GetClientByCredentials

func GetClientByCredentials() (*armresourcegraph.Client, error)

func GetMapValue

func GetMapValue(properties map[string]any, key string) map[string]any

func GetServiceBusQueuesClient added in v1.3.0

func GetServiceBusQueuesClient(subscriptionId string) (*armservicebus.QueuesClient, error)

GetServiceBusQueuesClient returns a per-subscription Service Bus QueuesClient. Used by the queue discovery to enumerate queues via the direct ARM API (Resource Graph indexes Service Bus child resources with a multi-minute lag — direct ARM is real-time).

func GetServiceBusTopicsClient added in v1.3.0

func GetServiceBusTopicsClient(subscriptionId string) (*armservicebus.TopicsClient, error)

GetServiceBusTopicsClient returns a per-subscription Service Bus TopicsClient. See GetServiceBusQueuesClient for the rationale on using direct ARM over Resource Graph.

func GetStringValue

func GetStringValue(val *string) string

func GetVirtualMachineScaleSetVMsClient

func GetVirtualMachineScaleSetVMsClient(subscriptionId string) (*armcompute.VirtualMachineScaleSetVMsClient, error)

func GetVirtualMachinesClient

func GetVirtualMachinesClient(subscriptionId string) (*armcompute.VirtualMachinesClient, error)

func StringFromMap added in v1.3.0

func StringFromMap(m map[string]any, key string) string

StringFromMap returns m[key] as a string, or "" if absent or not a string.

func StringSliceFromMap added in v1.3.0

func StringSliceFromMap(m map[string]any, key string) []string

StringSliceFromMap returns m[key] as []string. Returns nil if the key is absent or not a slice. Non-string and empty-string entries are skipped.

Types

Jump to

Keyboard shortcuts

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