utils

package
v0.0.0-...-c9498b4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLogLevel = zerolog.InfoLevel

Variables

View Source
var (
	// LogLevel Used for flags
	LogLevel zerolog.Level
	// LogJson Used for flags
	LogJson bool
)

Functions

func ConfigureLogger

func ConfigureLogger()

func GetKubernetesDynamicInterface

func GetKubernetesDynamicInterface() (dynamic.Interface, error)

func GetKubernetesInterface

func GetKubernetesInterface() (kubernetes.Interface, error)

func GetTestKubenertesInterface

func GetTestKubenertesInterface() (kubernetes.Interface, error)

func Murmur3Hasher

func Murmur3Hasher(member string, key string) uint64

NOTE: The python implementation of murmur3 may differ from the golang implementation. For now, this is fine since go and python don't need to agree on any hashing schemes but if we ever need to agree on a hashing scheme, we should verify that the implementations are the same.

func RunKubernetesIntegrationTest

func RunKubernetesIntegrationTest(t *testing.T, testFunc func(t *testing.T))

This helper function can be used to skip tests if the environment variable is not set appropriately.

func RunProcess

func RunProcess(startProcess func() (io.Closer, error))

func ShouldRunIntegrationTests

func ShouldRunIntegrationTests() bool

ShouldRunTests checks if the tests should be run based on an environment variable.

func WaitUntilSignal

func WaitUntilSignal(closers ...io.Closer)

Types

type Hasher

type Hasher = func(member string, key string) uint64

type Key

type Key = string

type Member

type Member = string

func Assign

func Assign(key Key, members Members, hasher Hasher) (Member, error)

assign assigns a key to a member using the rendezvous hashing algorithm.

type Members

type Members = []Member

Jump to

Keyboard shortcuts

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