cert-manager: github.com/jetstack/cert-manager/pkg/util Index | Files | Directories

package util

import "github.com/jetstack/cert-manager/pkg/util"


Package Files

context.go useragent.go util.go version.go


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 Uses

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

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

func ContextWithStopCh Uses

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 Uses

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

Test for equal IP slices even if unsorted

func EqualKeyUsagesUnsorted Uses

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

Test for equal KeyUsage slices even if unsorted

func EqualSorted Uses

func EqualSorted(s1, s2 []string) bool

func EqualURLsUnsorted Uses

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

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

func EqualUnsorted Uses

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

func OnlyOneNotNil Uses

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

func RandStringRunes Uses

func RandStringRunes(n int) string

func Subset Uses

func Subset(set, subset []string) bool

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

type Version Uses

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 Uses

func VersionInfo() Version


coveragePackage coverage provides tools for coverage-instrumented binaries to collect and flush coverage information.

Package util imports 9 packages (graph) and is imported by 64 packages. Updated 2020-08-05. Refresh now. Tools for package owners.