util

package
v0.7.0-alpha.18 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPathExists added in v0.6.0

func CheckPathExists(path string) (bool, error)

func ComputeHash

func ComputeHash(object interface{}) (string, error)

func EqSet

func EqSet(left, right *Sets) bool

func ExecShellCommand added in v0.6.0

func ExecShellCommand(cmd *exec.Cmd) (string, error)

func FromConfigFiles

func FromConfigFiles(files []string) (map[string]string, error)

func FromYamlConfig added in v0.6.0

func FromYamlConfig[T any](yamlConfig string, obj T) error

func JSONPatch

func JSONPatch(originalJSON, modifiedJSON interface{}) ([]byte, error)

func Max

func Max[T constraints.Ordered](l, r T) T

func Min

func Min[T constraints.Ordered](l, r T) T

func RetrievalWithJSONPath

func RetrievalWithJSONPath(jsonObj interface{}, jsonpath string) ([]byte, error)

func RunShellCommand added in v0.6.0

func RunShellCommand(cmd string, args ...string) (string, error)

func Safe2Int32 added in v0.6.0

func Safe2Int32(v int) int32

func ToArgs added in v0.6.0

func ToArgs(m map[string]string) []string

func ToPointer

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

func ToYamlConfig added in v0.6.0

func ToYamlConfig(obj interface{}) ([]byte, error)

func UnstructuredObjectWalk

func UnstructuredObjectWalk(data interface{}, fn NodeProcessFn, onlyAccessNode bool) error

Types

type NodeProcessFn

type NodeProcessFn func(parent, cur string, v reflect.Value, fn UpdateFn) error

type Sets added in v0.6.0

type Sets = set.LinkedHashSetString

func Difference

func Difference(left, right *Sets) *Sets

func MapKeyDifference

func MapKeyDifference[T interface{}](left, right map[string]T) *Sets

func NewSet added in v0.6.0

func NewSet(strings ...string) *Sets

func ToSet

func ToSet[T interface{}](v map[string]T) *Sets

func Union

func Union(left, right *Sets) *Sets

type UpdateFn

type UpdateFn func(v interface{})

Jump to

Keyboard shortcuts

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