internal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeTypes

func AttributeTypes[T any](ctx context.Context) (map[string]attr.Type, error)

AttributeTypes returns a map of attribute types for the specified type T. T must be a struct and reflection is used to find exported fields of T with the `tfsdk` tag.

func ExpandFrameworkSet

func ExpandFrameworkSet[SetT any, ExpandT any](ctx context.Context, set types.Set, f func(SetT) ExpandT) []ExpandT

ExpandFrameworkSet converts a framework Set value to a slice of values according to the specified map function f.

If the framework value is null or unknown, or if an error occurs when first converting the set into a slice of type SetT, an empty slice is returned.

func ExpandFrameworkStringSet

func ExpandFrameworkStringSet(ctx context.Context, tfSet types.Set) []string

ExpandFrameworkStringSet converts a framework Set value to a slice of string values.

If the framework value is null or unknown, or if an error occurs when first converting the set into a slice of element type string, an empty slice is returned.

func FlattenFrameworkSet

func FlattenFrameworkSet[T any](ctx context.Context, elementType attr.Type, list []T, f func(T) attr.Value) types.Set

FlattenFrameworkSet converts an arbitrary slice to a framework Set value of the specified elementType and map function f to do the conversion.

If the slice has 0 elements, then an empty set is returned.

func PrettyOneOf

func PrettyOneOf[T ~string](options []T) string

PrettyOneOf returns "(one of options...)"

func PrettyRFC3339Timestamp

func PrettyRFC3339Timestamp() string

PrettyRFC3339Timestamp returns "formatted as a UTC timestamp string in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) format"

func ResourceSchemaToDataSourceSchema

func ResourceSchemaToDataSourceSchema(resourceSchema map[string]resource_schema.Attribute, idField *string) map[string]datasource_schema.Attribute

ResourceSchemaToDataSourceSchema converts a resource schema to a data source schema by copying all common fields between the two schemas, and setting required = true for the specified id field

func StringFromFramework

func StringFromFramework(_ context.Context, v types.String) *string

StringFromFramework converts a Framework String value to a string pointer. A null String is converted to a nil string pointer.

Types

This section is empty.

Directories

Path Synopsis
bzdatasource provides abstractions that make it easier to write data sources for the BastionZero API.
bzdatasource provides abstractions that make it easier to write data sources for the BastionZero API.
Package testgen provides property based test (PBT) generators that can be used to test properties of the Terraform provider implementation
Package testgen provides property based test (PBT) generators that can be used to test properties of the Terraform provider implementation

Jump to

Keyboard shortcuts

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