Documentation
¶
Index ¶
- func DescriptionWithContextWarning(baseDescription string) string
- type Duration
- func (v Duration) Equal(o attr.Value) bool
- func (v Duration) Parse() (time.Duration, diag.Diagnostics)
- func (v Duration) StringSemanticEquals(_ context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
- func (v Duration) Type(_ context.Context) attr.Type
- func (v Duration) ValidateAttribute(_ context.Context, req xattr.ValidateAttributeRequest, ...)
- type DurationType
- func (t DurationType) Equal(o attr.Type) bool
- func (t DurationType) String() string
- func (t DurationType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
- func (t DurationType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t DurationType) ValueType(_ context.Context) attr.Value
- type JSONWithContextualDefaultsType
- func (t JSONWithContextualDefaultsType) Equal(o attr.Type) bool
- func (t JSONWithContextualDefaultsType) String() string
- func (t JSONWithContextualDefaultsType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
- func (t JSONWithContextualDefaultsType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t JSONWithContextualDefaultsType) ValueType(_ context.Context) attr.Value
- type JSONWithContextualDefaultsValue
- func (v JSONWithContextualDefaultsValue) Equal(o attr.Value) bool
- func (v JSONWithContextualDefaultsValue) SanitizedValue() (string, diag.Diagnostics)
- func (v JSONWithContextualDefaultsValue) StringSemanticEquals(ctx context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
- func (v JSONWithContextualDefaultsValue) Type(_ context.Context) attr.Type
- func (v JSONWithContextualDefaultsValue) ValidateAttribute(ctx context.Context, req xattr.ValidateAttributeRequest, ...)
- type JSONWithDefaultsType
- func (t JSONWithDefaultsType[TModel]) Equal(o attr.Type) bool
- func (t JSONWithDefaultsType[TModel]) String() string
- func (t JSONWithDefaultsType[TModel]) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
- func (t JSONWithDefaultsType[TModel]) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t JSONWithDefaultsType[TModel]) ValueType(_ context.Context) attr.Value
- type JSONWithDefaultsValue
- func NewJSONWithDefaultsNull[TModel any](populateDefaults PopulateDefaultsFunc[TModel]) JSONWithDefaultsValue[TModel]
- func NewJSONWithDefaultsUnknown[TModel any](populateDefaults PopulateDefaultsFunc[TModel]) JSONWithDefaultsValue[TModel]
- func NewJSONWithDefaultsValue[TModel any](value string, populateDefaults PopulateDefaultsFunc[TModel]) JSONWithDefaultsValue[TModel]
- func (v JSONWithDefaultsValue[TModel]) StringSemanticEquals(ctx context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
- func (v JSONWithDefaultsValue[TModel]) Type(_ context.Context) attr.Type
- func (v JSONWithDefaultsValue[TModel]) WithDefaults() (JSONWithDefaultsValue[TModel], diag.Diagnostics)
- type MemorySize
- func (v MemorySize) ConvertToMB() (int64, diag.Diagnostics)
- func (v MemorySize) Equal(o attr.Value) bool
- func (v MemorySize) StringSemanticEquals(_ context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
- func (v MemorySize) Type(_ context.Context) attr.Type
- func (v MemorySize) ValidateAttribute(_ context.Context, req xattr.ValidateAttributeRequest, ...)
- type MemorySizeType
- func (t MemorySizeType) Equal(o attr.Type) bool
- func (t MemorySizeType) String() string
- func (t MemorySizeType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
- func (t MemorySizeType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t MemorySizeType) ValueType(_ context.Context) attr.Value
- type NormalizedYamlType
- func (t NormalizedYamlType) Equal(o attr.Type) bool
- func (t NormalizedYamlType) String() string
- func (t NormalizedYamlType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
- func (t NormalizedYamlType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t NormalizedYamlType) ValueType(_ context.Context) attr.Value
- type NormalizedYamlValue
- func (v NormalizedYamlValue) StringSemanticEquals(_ context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
- func (v NormalizedYamlValue) Type(_ context.Context) attr.Type
- func (v NormalizedYamlValue) ValidateAttribute(_ context.Context, req xattr.ValidateAttributeRequest, ...)
- type PopulateDefaultsFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DescriptionWithContextWarning ¶ added in v0.14.0
Types ¶
type Duration ¶
type Duration struct {
basetypes.StringValue
}
func NewDurationNull ¶
func NewDurationNull() Duration
NewDurationNull creates a Duration with a null value. Determine whether the value is null via IsNull method.
func NewDurationPointerValue ¶
NewDurationPointerValue creates a Duration with a null value if nil or a known value. Access the value via ValueStringPointer method.
func NewDurationUnknown ¶
func NewDurationUnknown() Duration
NewDurationUnknown creates a Duration with an unknown value. Determine whether the value is unknown via IsUnknown method.
func NewDurationValue ¶
NewDurationValue creates a Duration with a known value. Access the value via ValueString method.
func (Duration) Parse ¶
func (v Duration) Parse() (time.Duration, diag.Diagnostics)
Parse calls time.ParseDuration with the Duration StringValue. A null or unknown value will produce an error diagnostic.
func (Duration) StringSemanticEquals ¶
func (v Duration) StringSemanticEquals(_ context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
StringSemanticEquals returns true if the given duration string value is semantically equal to the current duration string value. When compared, the durations are parsed into a time.Duration and the underlying nanosecond values compared.
func (Duration) ValidateAttribute ¶
func (v Duration) ValidateAttribute(_ context.Context, req xattr.ValidateAttributeRequest, resp *xattr.ValidateAttributeResponse)
type DurationType ¶
type DurationType struct {
basetypes.StringType
}
func (DurationType) Equal ¶
func (t DurationType) Equal(o attr.Type) bool
Equal returns true if the given type is equivalent.
func (DurationType) String ¶
func (t DurationType) String() string
String returns a human readable string of the type name.
func (DurationType) ValueFromString ¶
func (t DurationType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
ValueFromString returns a StringValuable type given a StringValue.
func (DurationType) ValueFromTerraform ¶
ValueFromTerraform returns a Value given a tftypes.Value. This is meant to convert the tftypes.Value into a more convenient Go type for the provider to consume the data with.
type JSONWithContextualDefaultsType ¶ added in v0.14.0
type JSONWithContextualDefaultsType struct {
jsontypes.NormalizedType
// contains filtered or unexported fields
}
func NewJSONWithContextualDefaultsType ¶ added in v0.14.0
func NewJSONWithContextualDefaultsType(populateDefaults func(contextValue string, value string) (string, error)) JSONWithContextualDefaultsType
func (JSONWithContextualDefaultsType) Equal ¶ added in v0.14.0
func (t JSONWithContextualDefaultsType) Equal(o attr.Type) bool
Equal returns true if the given type is equivalent.
func (JSONWithContextualDefaultsType) String ¶ added in v0.14.0
func (t JSONWithContextualDefaultsType) String() string
String returns a human readable string of the type name.
func (JSONWithContextualDefaultsType) ValueFromString ¶ added in v0.14.0
func (t JSONWithContextualDefaultsType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
ValueFromString returns a StringValuable type given a StringValue.
func (JSONWithContextualDefaultsType) ValueFromTerraform ¶ added in v0.14.0
func (t JSONWithContextualDefaultsType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
ValueFromTerraform returns a Value given a tftypes.Value.
type JSONWithContextualDefaultsValue ¶ added in v0.14.0
type JSONWithContextualDefaultsValue struct {
jsontypes.Normalized
// contains filtered or unexported fields
}
func NewJSONWithContextualDefaultsNull ¶ added in v0.14.0
func NewJSONWithContextualDefaultsNull() JSONWithContextualDefaultsValue
NewJSONWithContextualDefaultsNull creates a JSONWithContextualDefaults with a null value.
func NewJSONWithContextualDefaultsUnknown ¶ added in v0.14.0
func NewJSONWithContextualDefaultsUnknown() JSONWithContextualDefaultsValue
NewJSONWithContextualDefaultsUnknown creates a JSONWithContextualDefaults with an unknown value.
func NewJSONWithContextualDefaultsValue ¶ added in v0.14.0
func NewJSONWithContextualDefaultsValue( value string, contextValue string, populateDefaults func(contextValue string, value string) (string, error), ) (JSONWithContextualDefaultsValue, diag.Diagnostics)
NewJSONWithContextualDefaultsValue creates a JSONWithContext with a known value and a context value.
func (JSONWithContextualDefaultsValue) Equal ¶ added in v0.14.0
func (v JSONWithContextualDefaultsValue) Equal(o attr.Value) bool
Equal returns true if the given value is equivalent.
func (JSONWithContextualDefaultsValue) SanitizedValue ¶ added in v0.14.0
func (v JSONWithContextualDefaultsValue) SanitizedValue() (string, diag.Diagnostics)
func (JSONWithContextualDefaultsValue) StringSemanticEquals ¶ added in v0.14.0
func (v JSONWithContextualDefaultsValue) StringSemanticEquals(ctx context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
StringSemanticEquals returns true if the given config object value is semantically equal to the current config object value. The comparison will ignore any default values present in one value, but unset in the other.
func (JSONWithContextualDefaultsValue) Type ¶ added in v0.14.0
func (v JSONWithContextualDefaultsValue) Type(_ context.Context) attr.Type
Type returns a JSONWithContextType.
func (JSONWithContextualDefaultsValue) ValidateAttribute ¶ added in v0.14.0
func (v JSONWithContextualDefaultsValue) ValidateAttribute(ctx context.Context, req xattr.ValidateAttributeRequest, resp *xattr.ValidateAttributeResponse)
type JSONWithDefaultsType ¶ added in v0.12.2
type JSONWithDefaultsType[TModel any] struct { jsontypes.NormalizedType // contains filtered or unexported fields }
JSONWithDefaultsType is a generic type for JSON attributes that need default values populated
func NewJSONWithDefaultsType ¶ added in v0.12.2
func NewJSONWithDefaultsType[TModel any](populateDefaults PopulateDefaultsFunc[TModel]) JSONWithDefaultsType[TModel]
NewJSONWithDefaultsType creates a new JSONWithDefaultsType with the given PopulateDefaultsFunc
func (JSONWithDefaultsType[TModel]) Equal ¶ added in v0.12.2
func (t JSONWithDefaultsType[TModel]) Equal(o attr.Type) bool
Equal returns true if the given type is equivalent.
func (JSONWithDefaultsType[TModel]) String ¶ added in v0.12.2
func (t JSONWithDefaultsType[TModel]) String() string
String returns a human readable string of the type name.
func (JSONWithDefaultsType[TModel]) ValueFromString ¶ added in v0.12.2
func (t JSONWithDefaultsType[TModel]) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
ValueFromString returns a StringValuable type given a StringValue.
func (JSONWithDefaultsType[TModel]) ValueFromTerraform ¶ added in v0.12.2
func (t JSONWithDefaultsType[TModel]) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
ValueFromTerraform returns a Value given a tftypes.Value.
type JSONWithDefaultsValue ¶ added in v0.12.2
type JSONWithDefaultsValue[TModel any] struct { jsontypes.Normalized // contains filtered or unexported fields }
JSONWithDefaultsValue is a generic value type for JSON attributes that need default values populated
func NewJSONWithDefaultsNull ¶ added in v0.12.2
func NewJSONWithDefaultsNull[TModel any](populateDefaults PopulateDefaultsFunc[TModel]) JSONWithDefaultsValue[TModel]
NewJSONWithDefaultsNull creates a JSONWithDefaultsValue with a null value.
func NewJSONWithDefaultsUnknown ¶ added in v0.12.2
func NewJSONWithDefaultsUnknown[TModel any](populateDefaults PopulateDefaultsFunc[TModel]) JSONWithDefaultsValue[TModel]
NewJSONWithDefaultsUnknown creates a JSONWithDefaultsValue with an unknown value.
func NewJSONWithDefaultsValue ¶ added in v0.12.2
func NewJSONWithDefaultsValue[TModel any](value string, populateDefaults PopulateDefaultsFunc[TModel]) JSONWithDefaultsValue[TModel]
NewJSONWithDefaultsValue creates a JSONWithDefaultsValue with a known value.
func (JSONWithDefaultsValue[TModel]) StringSemanticEquals ¶ added in v0.12.2
func (v JSONWithDefaultsValue[TModel]) StringSemanticEquals(ctx context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
StringSemanticEquals returns true if the given value is semantically equal to the current value. The comparison will ignore any default values present in one value, but unset in the other.
func (JSONWithDefaultsValue[TModel]) Type ¶ added in v0.12.2
func (v JSONWithDefaultsValue[TModel]) Type(_ context.Context) attr.Type
Type returns a JSONWithDefaultsType.
func (JSONWithDefaultsValue[TModel]) WithDefaults ¶ added in v0.12.2
func (v JSONWithDefaultsValue[TModel]) WithDefaults() (JSONWithDefaultsValue[TModel], diag.Diagnostics)
WithDefaults applies default values to the JSON content
type MemorySize ¶ added in v0.12.2
type MemorySize struct {
basetypes.StringValue
}
func NewMemorySizeNull ¶ added in v0.12.2
func NewMemorySizeNull() MemorySize
NewMemorySizeNull creates a MemorySize with a null value. Determine whether the value is null via IsNull method.
func NewMemorySizePointerValue ¶ added in v0.12.2
func NewMemorySizePointerValue(value *string) MemorySize
NewMemorySizePointerValue creates a MemorySize with a null value if nil or a known value. Access the value via ValueStringPointer method.
func NewMemorySizeUnknown ¶ added in v0.12.2
func NewMemorySizeUnknown() MemorySize
NewMemorySizeUnknown creates a MemorySize with an unknown value. Determine whether the value is unknown via IsUnknown method.
func NewMemorySizeValue ¶ added in v0.12.2
func NewMemorySizeValue(value string) MemorySize
NewMemorySizeValue creates a MemorySize with a known value. Access the value via ValueString method.
func (MemorySize) ConvertToMB ¶ added in v0.12.2
func (v MemorySize) ConvertToMB() (int64, diag.Diagnostics)
ConvertToMB parses the memory size string and returns the equivalent number of megabytes. Supports units: k/K (kilobytes), m/M (megabytes), g/G (gigabytes), t/T (terabytes) The 'b' suffix is optional and ignored. Note: As per ML documentation, values are rounded down to the nearest MB for consistency.
func (MemorySize) Equal ¶ added in v0.12.2
func (v MemorySize) Equal(o attr.Value) bool
Equal returns true if the given value is equivalent.
func (MemorySize) StringSemanticEquals ¶ added in v0.12.2
func (v MemorySize) StringSemanticEquals(_ context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
StringSemanticEquals returns true if the given memory size string value is semantically equal to the current memory size string value. When compared, the memory sizes are parsed into bytes and the byte values compared.
func (MemorySize) Type ¶ added in v0.12.2
func (v MemorySize) Type(_ context.Context) attr.Type
Type returns a MemorySizeType.
func (MemorySize) ValidateAttribute ¶ added in v0.12.2
func (v MemorySize) ValidateAttribute(_ context.Context, req xattr.ValidateAttributeRequest, resp *xattr.ValidateAttributeResponse)
type MemorySizeType ¶ added in v0.12.2
type MemorySizeType struct {
basetypes.StringType
}
func (MemorySizeType) Equal ¶ added in v0.12.2
func (t MemorySizeType) Equal(o attr.Type) bool
Equal returns true if the given type is equivalent.
func (MemorySizeType) String ¶ added in v0.12.2
func (t MemorySizeType) String() string
String returns a human readable string of the type name.
func (MemorySizeType) ValueFromString ¶ added in v0.12.2
func (t MemorySizeType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
ValueFromString returns a StringValuable type given a StringValue.
func (MemorySizeType) ValueFromTerraform ¶ added in v0.12.2
func (t MemorySizeType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
ValueFromTerraform returns a Value given a tftypes.Value. This is meant to convert the tftypes.Value into a more convenient Go type for the provider to consume the data with.
type NormalizedYamlType ¶ added in v0.14.4
type NormalizedYamlType struct {
basetypes.StringType
}
NormalizedYamlType is a custom type for YAML attributes that performs semantic equality comparison, ignoring insignificant whitespace and key ordering differences.
func (NormalizedYamlType) Equal ¶ added in v0.14.4
func (t NormalizedYamlType) Equal(o attr.Type) bool
Equal returns true if the given type is equivalent.
func (NormalizedYamlType) String ¶ added in v0.14.4
func (t NormalizedYamlType) String() string
String returns a human readable string of the type name.
func (NormalizedYamlType) ValueFromString ¶ added in v0.14.4
func (t NormalizedYamlType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
ValueFromString returns a StringValuable type given a StringValue.
func (NormalizedYamlType) ValueFromTerraform ¶ added in v0.14.4
func (t NormalizedYamlType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
ValueFromTerraform returns a Value given a tftypes.Value.
type NormalizedYamlValue ¶ added in v0.14.4
type NormalizedYamlValue struct {
basetypes.StringValue
}
NormalizedYamlValue is a custom value type for YAML attributes.
func NewNormalizedYamlNull ¶ added in v0.14.4
func NewNormalizedYamlNull() NormalizedYamlValue
NewNormalizedYamlNull creates a NormalizedYamlValue with a null value.
func NewNormalizedYamlUnknown ¶ added in v0.14.4
func NewNormalizedYamlUnknown() NormalizedYamlValue
NewNormalizedYamlUnknown creates a NormalizedYamlValue with an unknown value.
func NewNormalizedYamlValue ¶ added in v0.14.4
func NewNormalizedYamlValue(value string) NormalizedYamlValue
NewNormalizedYamlValue creates a NormalizedYamlValue with a known value.
func (NormalizedYamlValue) StringSemanticEquals ¶ added in v0.14.4
func (v NormalizedYamlValue) StringSemanticEquals(_ context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
StringSemanticEquals returns true if both values are semantically equal YAML (i.e. parse to the same structure), regardless of whitespace or key ordering.
func (NormalizedYamlValue) Type ¶ added in v0.14.4
func (v NormalizedYamlValue) Type(_ context.Context) attr.Type
Type returns the type of the value.
func (NormalizedYamlValue) ValidateAttribute ¶ added in v0.14.4
func (v NormalizedYamlValue) ValidateAttribute(_ context.Context, req xattr.ValidateAttributeRequest, resp *xattr.ValidateAttributeResponse)
ValidateAttribute validates that the string value is valid YAML.
type PopulateDefaultsFunc ¶ added in v0.12.2
type PopulateDefaultsFunc[TModel any] func(model TModel) TModel
PopulateDefaultsFunc is a function that takes a parsed model and returns it with defaults populated