utils

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyObjectJson added in v0.5.0

func CopyObjectJson(in any, out any) error

json marshals to bytes then unmarshals into struct to fill a struct. Out has to be a pointer

func GetBlob

func GetBlob(d *schema.ResourceData, key string) map[string]interface{}

func GetBool

func GetBool(d *schema.ResourceData, key string) bool

func GetBoolP

func GetBoolP(d *schema.ResourceData, key string) *bool

func GetFloat64

func GetFloat64(d *schema.ResourceData, key string) float64

func GetFloat64P

func GetFloat64P(d *schema.ResourceData, key string) *float64

func GetInt

func GetInt(d *schema.ResourceData, key string) int

func GetIntP

func GetIntP(d *schema.ResourceData, key string) *int

func GetString

func GetString(d *schema.ResourceData, key string) string

func GetStringP

func GetStringP(d *schema.ResourceData, key string) *string

func PrintJson added in v0.9.0

func PrintJson(i interface{}) string

func Set

func Set(d *schema.ResourceData, key string, value any) error

func SetOrPanic

func SetOrPanic(d *schema.ResourceData, key string, value any)

func StructFromProps

func StructFromProps[S any](blobs any) (S, error)

func ToPointer added in v0.5.0

func ToPointer[T any](data T) *T

ToPointer returns a pointer of given data which kind of T

func ToValue added in v0.6.1

func ToValue[T any](p *T) T

ToValue returns an object to which p points, if p is nil, will return a zero value

Types

This section is empty.

Jump to

Keyboard shortcuts

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