util

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SyncWaitTime = 10 * time.Second
	CtxTimeout   = 30 * time.Second
)
View Source
const (
	RANDOM_SUFFIX_LEN = 10
	// k8s object name has a maximum length
	MAX_NAME_LEN = 63 - RANDOM_SUFFIX_LEN - 1
)

Variables

View Source
var (
	ErrWaitRequeue   = errors.New("wait requeue")
	ErrRsInitFailed  = errors.New("init_failed")
	ErrRsStatusNotOk = errors.New("replSet status not ok")
	ErrObjSync       = errors.New("sync k8s obj error")
)

Functions

func AddIndexSuffix

func AddIndexSuffix(name string, index int) string

func AddRandSuffix

func AddRandSuffix(name string) string

func AddSuffix

func AddSuffix(a, b string) string

func ContainsString

func ContainsString(slice []string, s string) bool

func GenerateKey

func GenerateKey(ln int) []byte

func TimeoutWrap

func TimeoutWrap(timeout time.Duration, fn func() error) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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