unmarshal

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRootValue

func GetRootValue(v reflect.Value, ut reflect.Type) reflect.Value

GetRootValue returns the root of the given value. The root will be the dereferenced type of the given reflect.Value instance.

Parameters:

  1. v = reflect.Value of the type whose root value should be determined.
  2. ut = unmarshaler type to test if the given value is an argo.Unmarshaler instance.

func IsConsumerFunc

func IsConsumerFunc(vt reflect.Type) bool

IsConsumerFunc tests whether the given type represents a function that may be used as an argo.Argument's consumer binding.

func IsUnmarshalable

func IsUnmarshalable(vt, ut reflect.Type) (out bool)

IsUnmarshalable tests the given reflect.Type value to see if it is something that Argonaut can unmarshal.

Unmarshalable values include pointers to basic types, maps, slices, or consumer functions.

Arguments:

  1. vt = Type of the value that we are testing to ensure that it is unmarshalable.
  2. ut = Unmarshaler type. This is a hacky way of getting around cyclic package imports with the argo package.

func IsUnmarshalableValue

func IsUnmarshalableValue(vt reflect.Type) bool

IsUnmarshalableValue tests whether the given type is a value type that may be unmarshalled.

func ToUnmarshalable

func ToUnmarshalable(
	arg string,
	ov reflect.Value,
	skipPtr bool,
	unmarshalerType reflect.Type,
) (reflect.Value, error)

func ToValidMap

func ToValidMap(v, ov reflect.Value, ut reflect.Type) (reflect.Value, error)

ToValidMap is butts and this comment line is meaningless.

Valid map types:

map[<basic>]<basic>
map[<basic>]<*basic>
map[<basic>][]byte
map[<basic>]<*[]byte>

func ToValidSlice

func ToValidSlice(v, ov reflect.Value, ut reflect.Type) (out reflect.Value, err error)

ToValidSlice is an internal method that is not exposed to package consumers.

Valid slice types:

[]<basic>
[]<*basic>
[][]byte
[]*[]byte

func ValidateContainerValue

func ValidateContainerValue(t reflect.Type, ov reflect.Value, ut reflect.Type) error

Types

type InvalidTypeError

type InvalidTypeError struct {
	Value reflect.Value
}

func (*InvalidTypeError) Error

func (i *InvalidTypeError) Error() string

type InvalidUnmarshalError

type InvalidUnmarshalError struct {
	Value    reflect.Value
	Argument string
}

func (InvalidUnmarshalError) Error

func (i InvalidUnmarshalError) Error() string

Jump to

Keyboard shortcuts

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