util

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToPtr

func BoolToPtr(b bool) *bool

func CallKey

func CallKey(v reflect.Value) string

CallKey is a helper to call the Key() function since this needs to happen a lot

func GetConfigVersion added in v2.11.0

func GetConfigVersion(raw []byte) (semver.Version, report.Report, error)

GetConfigVersion parses the version from the given raw config

func HandleParseErrors

func HandleParseErrors(rawConfig []byte, to interface{}) (report.Report, error)

HandleParseErrors will attempt to unmarshal an invalid rawConfig into "to". If it fails to unmarsh it will generate a report.Report from the errors.

func IntToPtr

func IntToPtr(x int) *int

func IsFalse added in v2.10.0

func IsFalse(b *bool) bool

func IsInvalidInConfig

func IsInvalidInConfig(k reflect.Kind) bool

func IsPrimitive

func IsPrimitive(k reflect.Kind) bool

func IsTrue added in v2.10.0

func IsTrue(b *bool) bool

func NilOrEmpty

func NilOrEmpty(s *string) bool

func NonZeroValue added in v2.10.0

func NonZeroValue(t reflect.Type) reflect.Value

Return a fully non-zero value for the specified type, recursively setting all fields and slices.

func NotEmpty

func NotEmpty(s *string) bool

func StrToPtr

func StrToPtr(s string) *string

Types

type IgnoresDups

type IgnoresDups interface {
	IgnoreDuplicates() map[string]struct{}
}

type Keyed

type Keyed interface {
	Key() string
}

type MergesKeys

type MergesKeys interface {
	MergedKeys() map[string]string
}

Jump to

Keyboard shortcuts

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