util

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AppGitState  = ""
	AppGitCommit = ""
	AppVersion   = "canary"
)

This variable block holds information used to build up the version string

View Source
var CertManagerUserAgent = "cert-manager/" + version()

CertManagerUserAgent is the user agent that http clients in this codebase should use

Functions

func Contains

func Contains(ss []string, s string) bool

Contains returns true if a string is contained in a string slice

func EqualIPsUnsorted added in v0.9.0

func EqualIPsUnsorted(s1, s2 []net.IP) bool

Test for equal IP slices even if unsorted

func EqualKeyUsagesUnsorted added in v0.15.0

func EqualKeyUsagesUnsorted(s1, s2 []cmapi.KeyUsage) bool

Test for equal KeyUsage slices even if unsorted

func EqualSorted added in v0.10.0

func EqualSorted(s1, s2 []string) bool

func EqualURLsUnsorted added in v0.9.0

func EqualURLsUnsorted(s1, s2 []*url.URL) bool

Test for equal URL slices even if unsorted. Panics if any element is nil

func EqualUnsorted

func EqualUnsorted(s1 []string, s2 []string) bool

func OnlyOneNotNil

func OnlyOneNotNil(items ...interface{}) (any bool, one bool)

func PrefixFromUserAgent added in v1.7.0

func PrefixFromUserAgent(u string) string

PrefixFromUserAgent takes the characters preceding the first /, quote unprintable character and then trim what's beyond the FieldManagerMaxLength limit. Taken from https://github.com/kubernetes/kubernetes/blob/9a75e7b0fd1b567f774a3373be640e19b33e7ef1/staging/src/k8s.io/apiserver/pkg/endpoints/handlers/create.go#L252

func RandStringRunes

func RandStringRunes(n int) string

func Subset added in v0.11.0

func Subset(set, subset []string) bool

Subset returns true if one slice is an unsorted subset of the first.

Types

type Version added in v0.15.0

type Version struct {
	GitVersion   string `json:"gitVersion"`
	GitCommit    string `json:"gitCommit"`
	GitTreeState string `json:"gitTreeState"`
	GoVersion    string `json:"goVersion"`
	Compiler     string `json:"compiler"`
	Platform     string `json:"platform"`
}

func VersionInfo added in v0.15.0

func VersionInfo() Version

Directories

Path Synopsis
Package coverage provides tools for coverage-instrumented binaries to collect and flush coverage information.
Package coverage provides tools for coverage-instrumented binaries to collect and flush coverage information.

Jump to

Keyboard shortcuts

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