Documentation ¶
Index ¶
- func ComputeChecksum(data interface{}) string
- func ComputeConfigMapChecksum(data map[string]string) string
- func ComputeSHA1Hex(in []byte) string
- func ComputeSHA256Hex(in []byte) string
- func ComputeSecretChecksum(data map[string][]byte) string
- func CreateSHA1Secret(username, password []byte) []byte
- func DecodeBase64(in string) ([]byte, error)
- func DecodeCertificate(bytes []byte) (*x509.Certificate, error)
- func DecodeCertificateRequest(data []byte) (*x509.CertificateRequest, error)
- func DecodePrivateKey(bytes []byte) (*rsa.PrivateKey, error)
- func DecodeRSAPrivateKeyFromPKCS8(bytes []byte) (*rsa.PrivateKey, error)
- func DeleteFromValuesMap(values map[string]interface{}, keys ...interface{}) (map[string]interface{}, error)
- func EncodeBase64(in []byte) string
- func EncodeCertificate(certificate []byte) []byte
- func EncodePrivateKey(key *rsa.PrivateKey) []byte
- func EncodePrivateKeyInPKCS8(key *rsa.PrivateKey) ([]byte, error)
- func EncodeSHA1(in []byte) string
- func FindFreePort() (int, error)
- func FromValuesMap(values map[string]interface{}, v interface{}) error
- func GenerateRandomString(n int) (string, error)
- func GenerateRandomStringFromCharset(n int, allowedCharacters string) (string, error)
- func GetFromValuesMap(values map[string]interface{}, keys ...interface{}) (interface{}, error)
- func HashForMap(m map[string]interface{}) string
- func IDForKeyWithOptionalValue(key string, value *string) string
- func IifString(condition bool, onTrue, onFalse string) string
- func Indent(str string, spaces int) string
- func InitValuesMap(values map[string]interface{}) map[string]interface{}
- func IntStrPtrFromInt(port int) *intstr.IntOrString
- func IntStrPtrFromString(port string) *intstr.IntOrString
- func MergeMaps(a, b map[string]interface{}) map[string]interface{}
- func MergeStringMaps(oldMap map[string]string, newMaps ...map[string]string) map[string]string
- func MustNewRequirement(key string, op selection.Operator, vals ...string) labels.Requirement
- func ProtocolPtr(protocol corev1.Protocol) *corev1.Protocol
- func QuantityPtr(q resource.Quantity) *resource.Quantity
- func RandomDuration(max time.Duration) time.Duration
- func RandomDurationWithMetaDuration(max *metav1.Duration) time.Duration
- func SHA1(in []byte) []byte
- func SHA256(in []byte) []byte
- func SetToValuesMap(values map[string]interface{}, v interface{}, keys ...interface{}) (map[string]interface{}, error)
- func ShallowCopyMapStringInterface(values map[string]interface{}) map[string]interface{}
- func TestEmail(email string) bool
- func TimeElapsed(timestamp *metav1.Time, duration time.Duration) bool
- func TimePtr(t time.Time) *time.Time
- func TimePtrDeref(ptr *time.Time, def time.Time) time.Time
- func ToValuesMap(v interface{}) (map[string]interface{}, error)
- func ToValuesMapWithOptions(v interface{}, opt Options) (map[string]interface{}, error)
- func ValueExists(value string, list []string) bool
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeChecksum ¶ added in v1.8.0
func ComputeChecksum(data interface{}) string
ComputeChecksum computes a SHA256 checksum for the given data.
func ComputeConfigMapChecksum ¶ added in v1.28.0
ComputeConfigMapChecksum computes the sha256 checksum of configmap data.
func ComputeSHA1Hex ¶
ComputeSHA1Hex computes the hexadecimal representation of the SHA1 hash of the given input byte slice <in>, converts it to a string and returns it (length of returned string is 40 characters).
func ComputeSHA256Hex ¶
ComputeSHA256Hex computes the hexadecimal representation of the SHA256 hash of the given input byte slice <in>, converts it to a string and returns it.
func ComputeSecretChecksum ¶ added in v1.28.0
ComputeSecretChecksum computes the sha256 checksum of secret data.
func CreateSHA1Secret ¶
CreateSHA1Secret takes a username and a password and returns a sha1-schemed credentials pair as bytes.
func DecodeBase64 ¶
DecodeBase64 takes a Base64-encoded string and returns the decoded byte slice.
func DecodeCertificate ¶
func DecodeCertificate(bytes []byte) (*x509.Certificate, error)
DecodeCertificate takes a byte slice, decodes it from the PEM format, converts it to an x509.Certificate object, and returns it. In case an error occurs, it returns the error.
func DecodeCertificateRequest ¶ added in v1.23.0
func DecodeCertificateRequest(data []byte) (*x509.CertificateRequest, error)
DecodeCertificateRequest parses the given PEM-encoded CSR.
func DecodePrivateKey ¶
func DecodePrivateKey(bytes []byte) (*rsa.PrivateKey, error)
DecodePrivateKey takes a byte slice, decodes it from the PEM format, converts it to an rsa.PrivateKey object, and returns it. In case an error occurs, it returns the error.
func DecodeRSAPrivateKeyFromPKCS8 ¶ added in v1.7.0
func DecodeRSAPrivateKeyFromPKCS8(bytes []byte) (*rsa.PrivateKey, error)
DecodeRSAPrivateKeyFromPKCS8 takes a byte slice, decodes it from the PKCS8 format, tries to convert it to an rsa.PrivateKey object, and returns it. In case an error occurs, it returns the error.
func DeleteFromValuesMap ¶ added in v1.18.0
func DeleteFromValuesMap(values map[string]interface{}, keys ...interface{}) (map[string]interface{}, error)
DeleteFromValuesMap deletes the element at the specified location in the given values map, e.g. DeleteFromValuesMap(values, "a", 0, "b") deletes values["a"][0]["b"]. If such an element does not exist, it returns the given values map unmodified. All keys must be of type either string (for map keys) or int (for slice indexes). If a key type doesn't match the corresponding element type (string for map, int for slice), an error is returned.
func EncodeBase64 ¶
EncodeBase64 takes a byte slice and returns the Base64-encoded string.
func EncodeCertificate ¶
EncodeCertificate takes a certificate as a byte slice, encodes it to the PEM format, and returns it as byte slice.
func EncodePrivateKey ¶
func EncodePrivateKey(key *rsa.PrivateKey) []byte
EncodePrivateKey takes a RSA private key object, encodes it to the PEM format, and returns it as a byte slice.
func EncodePrivateKeyInPKCS8 ¶
func EncodePrivateKeyInPKCS8(key *rsa.PrivateKey) ([]byte, error)
EncodePrivateKeyInPKCS8 takes a RSA private key object, encodes it to the PKCS8 format, and returns it as a byte slice.
func EncodeSHA1 ¶
EncodeSHA1 takes a byte slice and returns the sha1-hashed string (base64-encoded).
func FindFreePort ¶
FindFreePort finds a free port on the host machine and returns it.
func FromValuesMap ¶ added in v1.18.0
FromValuesMap converts the given values map values to the given value v, by first marshalling it to JSON, and then unmarshalling the result from JSON into v. If values cannot be marshalled to JSON, or if the result cannot be unmarshalled into v, an error is returned.
func GenerateRandomString ¶
GenerateRandomString uses crypto/rand to generate a random string of the specified length <n>. The set of allowed characters is [0-9a-zA-Z], thus no special characters are included in the output. Returns error if there was a problem during the random generation.
func GenerateRandomStringFromCharset ¶
GenerateRandomStringFromCharset generates a cryptographically secure random string of the specified length <n>. The set of allowed characters can be specified. Returns error if there was a problem during the random generation.
func GetFromValuesMap ¶ added in v1.18.0
GetFromValuesMap returns the element at the specified location in the given values map, e.g. GetFromValuesMap(values, "a", 0, "b") returns values["a"][0]["b"], if such an element exists. If such an element does not exist, it returns nil. All keys must be of type either string (for map keys) or int (for slice indexes). If a key type doesn't match the corresponding element type (string for map, int for slice), an error is returned.
func HashForMap ¶
HashForMap creates a hash value for a map of type map[string]interface{} and returns it.
func IDForKeyWithOptionalValue ¶ added in v1.6.0
IDForKeyWithOptionalValue returns an identifier for the given key + optional value.
func IifString ¶ added in v1.38.0
IifString returns onTrue if the condition is true, and onFalse otherwise. It is similar to the ternary operator (?:) and the IIF function (see https://en.wikipedia.org/wiki/IIf) in other languages.
func InitValuesMap ¶ added in v1.18.0
InitValuesMap returns the given values map if it is non-nil, or a newly allocated values map if it is nil.
func IntStrPtrFromInt ¶ added in v1.65.0
func IntStrPtrFromInt(port int) *intstr.IntOrString
IntStrPtrFromInt returns an intstr.IntOrString pointer to its argument.
func IntStrPtrFromString ¶ added in v1.65.0
func IntStrPtrFromString(port string) *intstr.IntOrString
IntStrPtrFromString returns an intstr.IntOrString pointer to its argument.
func MergeMaps ¶
MergeMaps takes two maps <a>, <b> and merges them. If <b> defines a value with a key already existing in the <a> map, the <a> value for that key will be overwritten.
func MergeStringMaps ¶
MergeStringMaps merges the content of the newMaps with the oldMap. If a key already exists then it gets overwritten by the last value with the same key.
func MustNewRequirement ¶ added in v1.12.0
MustNewRequirement creates a labels.Requirement with the given values and panics if there is an error.
func ProtocolPtr ¶ added in v1.65.0
ProtocolPtr returns a corev1.Protocol pointer to its argument.
func QuantityPtr ¶ added in v1.8.0
QuantityPtr returns a Quantity pointer to its argument.
func RandomDuration ¶ added in v1.8.1
RandomDuration takes a time.Duration and computes a non-negative pseudo-random duration in [0,max). It returns 0ns if max is <= 0ns.
func RandomDurationWithMetaDuration ¶ added in v1.8.1
RandomDurationWithMetaDuration takes a *metav1.Duration and computes a non-negative pseudo-random duration in [0,max). It returns 0ns if max is nil or <= 0ns.
func SetToValuesMap ¶ added in v1.18.0
func SetToValuesMap(values map[string]interface{}, v interface{}, keys ...interface{}) (map[string]interface{}, error)
SetToValuesMap sets the given element v to the specified location in the given values map, e.g. SetToValuesMap(values, v, "a", 0, "b") sets values["a"][0]["b"] = v. All map and slice elements along the way that don't exist are created and set at their corresponding locations. All keys must be of type either string (for map keys) or int (for slice indexes). Slice indexes must refer to existing slice elements or the first element beyond the end of a slice. If a key type doesn't match the corresponding element type (string for map, int for slice), an error is returned.
func ShallowCopyMapStringInterface ¶ added in v1.17.0
ShallowCopyMapStringInterface creates a shallow copy of the given map.
func TestEmail ¶
TestEmail validates the provided <email> against a regular expression and returns whether it matches.
func TimeElapsed ¶
TimeElapsed takes a <timestamp> and a <duration> checks whether the elapsed time until now is less than the <duration>. If yes, it returns true, otherwise it returns false.
func TimePtrDeref ¶ added in v1.67.0
TimePtrDeref dereferences the time.Time ptr and returns it if not nil, or else returns def.
func ToValuesMap ¶ added in v1.18.0
ToValuesMap converts the given value v to a values map, by first marshalling it to JSON, and then unmarshalling the result from JSON into a values map. If v cannot be marshalled to JSON, or if the result cannot be unmarshalled into a values map, an error is returned.
func ToValuesMapWithOptions ¶ added in v1.36.0
ToValuesMapWithOptions converts the given value v to a values map, by first marshalling it to JSON, and then unmarshalling the result from JSON into a values map. If v cannot be marshalled to JSON, or if the result cannot be unmarshalled into a values map, an error is returned.
func ValueExists ¶
ValueExists returns true or false, depending on whether the given string <value> is part of the given []string list <list>.
Types ¶
type Options ¶ added in v1.36.0
type Options struct { // LowerCaseKeys forces the keys to be lower case for the first character LowerCaseKeys bool // RemoveZeroEntries removes the map entry if the value is the zero value for its type // For example: removes the map entry if the value is string(""), bool(false) or int(0) RemoveZeroEntries bool }
Options are options for marshalling
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
Package flow provides utilities to construct a directed acyclic computational graph that is then executed and monitored with maximum parallelism.
|
Package flow provides utilities to construct a directed acyclic computational graph that is then executed and monitored with maximum parallelism. |
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
Package images contains constants for image names in the image vector.
|
Package images contains constants for image names in the image vector. |
client/mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |