utils

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRegion string

Functions

func ExtractId

func ExtractId(oldID string) string

Function to get the ID from the region + ID string

func ExtractRegion added in v0.7.0

func ExtractRegion(oldID string) string

Function to get the region from the region + ID string

func GetDBClientFromMeta added in v0.5.0

func GetDBClientFromMeta(meta interface{}, d *schema.ResourceData) (*sqlx.DB, clients.Region, error)

func SetDefaultRegion added in v0.5.0

func SetDefaultRegion(region string) error

func TransformIdWithRegion

func TransformIdWithRegion(region string, oldID string) string

Helper function to prepend region to the ID

Types

type ProviderMeta added in v0.5.0

type ProviderMeta struct {
	// DB is a map that associates each supported region with its corresponding
	// database client. This allows for region-specific database operations.
	DB map[clients.Region]*clients.DBClient

	// Frontegg represents the client used to interact with the Frontegg API,
	// which may involve authentication, token management, etc.
	Frontegg *clients.FronteggClient

	// CloudAPI is the client used for interactions with the cloud API
	CloudAPI *clients.CloudAPIClient

	// DefaultRegion specifies the default region to be used when no specific
	// region is provided in the resources and data sources.
	DefaultRegion clients.Region

	// RegionsEnabled is a map indicating which regions are currently enabled
	// for use. This can be used to quickly check the availability in different regions.
	RegionsEnabled map[clients.Region]bool
}

ProviderMeta holds essential configuration and client information required across various parts of the provider. It acts as a central repository of shared data, particularly for database connections, API clients, and regional settings.

func GetProviderMeta added in v0.5.0

func GetProviderMeta(meta interface{}) (*ProviderMeta, error)

Jump to

Keyboard shortcuts

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