utils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnnotationScope annotation name for defining instance scope. Used for specifying cluster wide clusters.
	// A namespace-scoped operator watches and manages resources in a single namespace, whereas a cluster-scoped operator watches and manages resources cluster-wide.
	AnnotationScope = "redis.kun/scope"
	//AnnotationClusterScoped annotation value for cluster wide clusters.
	AnnotationClusterScoped = "cluster-scoped"
)

Variables

This section is empty.

Functions

func BuildCommandReplaceMapping

func BuildCommandReplaceMapping(filePath string, log logr.Logger) map[string]string

buildCommandReplaceMapping reads the config file with the command-replace lines and build a mapping of bad lines are ignored silently

func CompareInt32

func CompareInt32(name string, old, new int32, reqLogger logr.Logger) bool

func CompareIntValue

func CompareIntValue(name string, old, new *int32, reqLogger logr.Logger) bool

func CompareStringValue

func CompareStringValue(name string, old, new string, reqLogger logr.Logger) bool

func Int32

func Int32(v *int32) int32

Int32 returns the value of the int32 pointer passed in or 0 if the pointer is nil.

func IsClusterScoped

func IsClusterScoped() bool

func MergeLabels

func MergeLabels(allLabels ...map[string]string) map[string]string

MergeLabels merges all the label maps received as argument into a single new label map.

func ParseRedisMemConf

func ParseRedisMemConf(p string) (string, error)

func Round

func Round(num float64) int

func SetClusterScoped

func SetClusterScoped(namespace string)

func ShoudManage

func ShoudManage(meta metav1.Object) bool

func SliceJoin

func SliceJoin(a []Stringer, sep string) string

SliceJoin concatenates the elements of a to create a single string. The separator string sep is placed between elements in the resulting string.

Types

type Stringer

type Stringer interface {
	String() string
}

Stringer implement the string interface

Jump to

Keyboard shortcuts

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