internal

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MurmurHash3Sum

func MurmurHash3Sum(data []byte, seed uint32) uint32

func NewMurmurHash3

func NewMurmurHash3(seed uint32) hash.Hash32

func NewRand

func NewRand() *rand.Rand

NewRand returns a properly seeded *rand.Rand.

The returned value is not thread-safe. If you need a thread-safe random number generator, use the top-level functions of the "math/rand/v2" package. They are not as fast as the Go 1 ("math/rand") generator, but they are much faster if access to the Go 1 generator must be guarded by a mutex.

Types

type Clock

type Clock interface {
	After(d time.Duration) <-chan time.Time
	Sleep(d time.Duration)
	Now() time.Time
	Since(t time.Time) time.Duration
	NewTicker(d time.Duration) Ticker
	NewTimer(d time.Duration) Timer
	AfterFunc(d time.Duration, f func()) Timer
}

Clock is an interface that is compatible with the jonboulle/clockwork package. The intent is that clockwork package only be a dependency for tests, not for non-test code.

func NewRealClock

func NewRealClock() Clock

NewRealClock returns a Clock implementation where all methods delegate to the corresponding function in the time package.

type MurmurHash3

type MurmurHash3 struct {
	// contains filtered or unexported fields
}

func (*MurmurHash3) BlockSize

func (h *MurmurHash3) BlockSize() int

func (*MurmurHash3) Reset

func (h *MurmurHash3) Reset()

func (*MurmurHash3) Size

func (h *MurmurHash3) Size() int

func (*MurmurHash3) Sum

func (h *MurmurHash3) Sum(b []byte) []byte

func (*MurmurHash3) Sum32

func (h *MurmurHash3) Sum32() uint32

func (*MurmurHash3) Write

func (h *MurmurHash3) Write(data []byte) (int, error)

type Ticker

type Ticker interface {
	Chan() <-chan time.Time
	Reset(d time.Duration)
	Stop()
}

Ticker is an interface covering the behavior of a time.Ticker.

type Timer

type Timer interface {
	Chan() <-chan time.Time
	Reset(d time.Duration) bool
	Stop() bool
}

Timer is an interface covering the behavior of a time.Timer.

Directories

Path Synopsis
Package balancertesting provides some helper functions and types that can be useful when testing custom load balancer implementations.
Package balancertesting provides some helper functions and types that can be useful when testing custom load balancer implementations.
Package clocktest exists to allow interoperability with our Clock interface and the Clockwork FakeClock.
Package clocktest exists to allow interoperability with our Clock interface and the Clockwork FakeClock.
Package conns contains internal helpers relating to conn.Conns values.
Package conns contains internal helpers relating to conn.Conns values.

Jump to

Keyboard shortcuts

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