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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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