helpers

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s []string, str string) bool

func GetInt64List

func GetInt64List(result []gjson.Result) types.List

func GetInt64Set added in v0.8.0

func GetInt64Set(result []gjson.Result) types.Set

func GetStringList

func GetStringList(result []gjson.Result) types.List

func GetStringSet added in v0.8.0

func GetStringSet(result []gjson.Result) types.Set

func GetValueSlice

func GetValueSlice(result []gjson.Result) []attr.Value

func IsFlagImporting added in v0.5.8

func IsFlagImporting(ctx context.Context, req resource.ReadRequest) (bool, diag.Diagnostics)

func LastElement

func LastElement(path string) string

func Must added in v0.5.8

func Must[T any](v T, err error) T

func RemoveEmptyStrings added in v0.7.0

func RemoveEmptyStrings(s []string) []string

func SetFlagImporting added in v0.5.8

func SetFlagImporting(ctx context.Context, importing bool, sk SetKeyer, respDiags *diag.Diagnostics)

SetFlagImporting checks the respDiags and if they are error-free it sets the `importing` as a private flag inside SetKeyer. It appends its own results to respDiags.

The caller must include in respDiags the result of state modification in the first place, to ensure consistency. The SetKeyer is something like resp.Private.

Types

type AttributeDescription

type AttributeDescription struct {
	String string
}

func NewAttributeDescription

func NewAttributeDescription(s string) *AttributeDescription

func (*AttributeDescription) AddDefaultValueDescription

func (d *AttributeDescription) AddDefaultValueDescription(defaultValue string) *AttributeDescription

func (*AttributeDescription) AddFloatRangeDescription

func (d *AttributeDescription) AddFloatRangeDescription(min, max float64) *AttributeDescription

func (*AttributeDescription) AddIntegerRangeDescription

func (d *AttributeDescription) AddIntegerRangeDescription(min, max int64) *AttributeDescription

func (*AttributeDescription) AddStringEnumDescription

func (d *AttributeDescription) AddStringEnumDescription(values ...string) *AttributeDescription

type SetKeyer added in v0.5.8

type SetKeyer interface {
	SetKey(ctx context.Context, key string, value []byte) diag.Diagnostics
}

SetKeyer is something like ReadResponse.Private or ImportStateResponse.Private.

Jump to

Keyboard shortcuts

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