value

package
v0.0.1-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 2 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(val any) (bool, error)

func List

func List[T any](val any) ([]T, error)

func Map

func Map[T any](val any) (map[string]T, error)

func ParseProto

func ParseProto(val *providerpb.Value) (any, error)

func String

func String(val any) (string, error)

func ToImmutableType

func ToImmutableType(subTypeConvertFunc func(any) any) func(any) Immutable

func ToType

func ToType[T any](val any) any

func ToValueProto

func ToValueProto(val any) (*providerpb.Value, error)

Types

type File

type File struct {
	Path     string
	Checksum string
}

func ParseFile

func ParseFile(val any) (File, error)

type Identifier

type Identifier struct {
	ResourceType string
	Value        any
}

func ParseIdentifier

func ParseIdentifier(val any) (Identifier, error)

func ParseIdentifierProto

func ParseIdentifierProto(id *providerpb.Identifier) (Identifier, error)

type Immutable

type Immutable struct {
	Value any
}

type Operation

type Operation string
const (
	OperationUpdate Operation = "update"
	OperationDelete Operation = "delete"
)

type Resource

type Resource struct {
	Identifier Identifier
	Config     any
	Attrs      any
}

func (Resource) ToResourceProto

func (r Resource) ToResourceProto() (*providerpb.Resource, error)

type ResourceIdentifier

type ResourceIdentifier interface {
	ResourceType() string
	ToValue() Identifier
}

type ResourceType

type ResourceType interface {
	ToValue() any
}

type UpdateMaskField

type UpdateMaskField struct {
	Name      string
	SubFields []UpdateMaskField
	Operation Operation
}

Jump to

Keyboard shortcuts

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