util

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: Apache-2.0 Imports: 8 Imported by: 58

Documentation

Overview

Copyright 2021 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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