Back to

Package util

Latest Go to latest

The latest major version is .

Published: Aug 7, 2020 | License: Apache-2.0 | Module:



var (
	AppGitState  = ""
	AppGitCommit = ""
	AppVersion   = "canary"

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

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

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

func Contains

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

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

func ContextWithStopCh

func ContextWithStopCh(ctx context.Context, stopCh <-chan struct{}) context.Context

ContextWithStopCh will wrap a context with a stop channel. When the provided stopCh closes, the cancel() will be called on the context. This provides a convenient way to represent a stop channel as a context.

func EqualIPsUnsorted

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

Test for equal IP slices even if unsorted

func EqualKeyUsagesUnsorted

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

Test for equal KeyUsage slices even if unsorted

func EqualSorted

func EqualSorted(s1, s2 []string) bool

func EqualURLsUnsorted

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 RandStringRunes

func RandStringRunes(n int) string

func Subset

func Subset(set, subset []string) bool

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

type Version

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

func VersionInfo() Version

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier