utils

package
v0.5.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package utils implements the util functions

Index

Constants

View Source
const (
	// ManagedAnnotation indicates the object is managed by the controller
	ManagedAnnotation = "cloud.streamnative.io/managed"
)

Variables

This section is empty.

Functions

func CalculateSecretKeyMd5 added in v0.4.5

func CalculateSecretKeyMd5(secret *corev1.Secret, key string) (string, error)

CalculateSecretKeyMd5 calculates the hash of the secret key.

func ConvertJSONToMapStringInterface added in v0.5.0

func ConvertJSONToMapStringInterface(raw *apiextensionsv1.JSON) (map[string]interface{}, error)

ConvertJSONToMapStringInterface converts a JSON object to a map[string]interface{}

func ConvertMap added in v0.5.0

func ConvertMap(input map[string]string) map[string]interface{}

ConvertMap converts a map[string]string to a map[string]interface{}

func IsManaged

func IsManaged(object metav1.Object) bool

IsManaged returns true if the object is under control of the controller by checking the specific annotation

Types

type Duration added in v0.4.0

type Duration string

Duration represents a elapsed time in string.

func (*Duration) Parse added in v0.4.0

func (d *Duration) Parse() (time.Duration, error)

Parse parses a duration from string. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w".

Jump to

Keyboard shortcuts

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