Documentation ¶
Index ¶
- Variables
- func ExtractId(fullId string) string
- func ExtractIdType(fullId string) string
- func ExtractPrefixedId(id string) (string, string, bool, error)
- func ExtractRegion(oldID string) string
- func GetDBClientFromMeta(meta interface{}, d *schema.ResourceData) (*sqlx.DB, clients.Region, error)
- func SetDefaultRegion(region string) error
- func TransformIdWithRegion(region string, oldID string) string
- func TransformIdWithTypeAndRegion(region string, idType string, value string) string
- type ProviderMeta
- type ProviderMode
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRegion string
Functions ¶
func ExtractIdType ¶ added in v0.8.6
func ExtractPrefixedId ¶ added in v0.8.6
Function to extract the prefix and value from a prefixed ID
func ExtractRegion ¶ added in v0.7.0
Function to get the region from the region + ID string
func GetDBClientFromMeta ¶ added in v0.5.0
func SetDefaultRegion ¶ added in v0.5.0
func TransformIdWithRegion ¶
Helper function to prepend region to the ID
Types ¶
type ProviderMeta ¶ added in v0.5.0
type ProviderMeta struct { // Mode represents the mode in which the provider is operating: default to SaaS Mode ProviderMode // 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 // DefaultRegion specifies the default region to be used when no specific // region is provided in the resources and data sources. DefaultRegion clients.Region // 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 // 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 // Frontegg Roles is a map that associates each Frontegg role with its corresponding ID. // This is used to map role names to role IDs when creating/updating users. FronteggRoles map[string]string }
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)
func (*ProviderMeta) IsSaaS ¶ added in v0.8.12
func (p *ProviderMeta) IsSaaS() bool
func (*ProviderMeta) IsSelfHosted ¶ added in v0.8.12
func (p *ProviderMeta) IsSelfHosted() bool
type ProviderMode ¶ added in v0.8.12
type ProviderMode string
ProviderMode represents the mode in which the provider is operating
const ( ModeSaaS ProviderMode = "saas" ModeSelfHosted ProviderMode = "self_hosted" )
Click to show internal directories.
Click to hide internal directories.