type_conversion

package
v0.18.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnySliceToTypedSlice

func AnySliceToTypedSlice(input any) any

AnySliceToTypedSlice determines whether input is []any and if so converts to an array of the underlying type

func CtyToGo

func CtyToGo(v cty.Value) (val interface{}, err error)

func CtyToJSON

func CtyToJSON(val cty.Value) (string, error)

CtyToJSON converts a cty value to it;s JSON representation

func CtyToPostgresString

func CtyToPostgresString(v cty.Value) (valStr string, err error)

CtyToPostgresString convert a cty value into a postgres representation of the value

func CtyToString

func CtyToString(v cty.Value) (valStr string, err error)

CtyToString convert a cty value into a string representation of the value

func CtyTypeToHclType

func CtyTypeToHclType(types ...cty.Type) string

CtyTypeToHclType converts a cty type to a hcl type accept multiple types and use the first non null and non dynamic one

func GoToPostgresString

func GoToPostgresString(v any) (string, error)

GoToPostgresString convert a go value into a postgres representation of the value

func QuotePostgresBytes

func QuotePostgresBytes(buf []byte) string

QuotePostgresBytes taken from github.com/jackc/pgx/v5@v4.17.2/internal/sanitize/sanitize.go

func QuotePostgresString

func QuotePostgresString(str string) string

QuotePostgresString taken from github.com/jackc/pgx/v5@v4.17.2/internal/sanitize/sanitize.go

func ToTypedSlice

func ToTypedSlice[T any](input []any) []T

ToTypedSlice converts []any to []T

Types

This section is empty.

Jump to

Keyboard shortcuts

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