util

package
v0.8.3-beta.11 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: AGPL-3.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPathExists

func CheckPathExists(path string) (bool, error)

func ComputeHash

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

func EqSet

func EqSet(left, right *Sets) bool

func ExecShellCommand

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

func FromConfigFiles

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

func FromYamlConfig

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

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

func Safe2Int32

func Safe2Int32(v int) int32

func ToArgs

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

func ToPointer

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

func ToYamlConfig

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

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

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