Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ValidateBooleanString = StringInSlice([]string{provider.BooleanTrue, provider.BooleanFalse}, false)
var ValidateBooleanStringWithDefault = StringInSlice([]string{provider.BooleanTrue, provider.BooleanFalse, provider.BooleanDefault}, false)
Functions ¶
func IsValidIdentifier ¶
func IsValidIdentifier[T sdk.AccountObjectIdentifier | sdk.DatabaseObjectIdentifier | sdk.SchemaObjectIdentifier | sdk.TableColumnIdentifier]() schema.SchemaValidateDiagFunc
IsValidIdentifier is a validator that can be used for validating identifiers passed in resources and data sources.
Typically, we expect passed identifiers to be a variation of sdk.ObjectIdentifier. For now, we're expecting implementations of sdk.ObjectIdentifier, because we won't support sdk.ExternalObjectIdentifiers. The reason behind it is that the functions that parse identifiers are not able to differentiate between sdk.ExternalObjectIdentifiers and sdk.DatabaseObjectIdentifier or sdk.SchemaObjectIdentifier. That's because sdk.ExternalObjectIdentifiers has varying parts count (2 or 3).
To use this function, pass it as a validation function on identifier field with generic parameter set to the desired sdk.ObjectIdentifier implementation.
func NormalizeValidation ¶
func NormalizeValidation[T any](normalize func(string) (T, error)) schema.SchemaValidateDiagFunc
func StringInSlice ¶
func StringInSlice(valid []string, ignoreCase bool) schema.SchemaValidateDiagFunc
StringInSlice has the same implementation as validation.StringInSlice, but adapted to schema.SchemaValidateDiagFunc
Types ¶
This section is empty.