extconversion

package
v1.8.20 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 1 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(from any, to any) error

Convert converts a value (from - typically a struct or map[string]interface{}) to another value (to - typically also a struct or map[string]interface{}). This is helpful in a variety of cases, e.g., to encode ActionKit's action state.

This function leverages json.Marshal and json.Unmarshal internally whereas it previously leveraged the mapstructure package. It turned out that using the json package is beneficial, as many go internal (time.Time) and external packages (Kubernetes resource types) are compatible with the json package, but not with mapstructure.

Types

This section is empty.

Jump to

Keyboard shortcuts

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