package util

Import Path
	github.com/redis/go-redis/v9/internal/util (on go.dev)

Dependency Relation
	imports 5 packages, and imported by 5 packages


Package-Level Type Names (total 2)
/* sort by: | */
AtomicMax is a thread-safe max container - hasValue indicator true if a value was equal to or greater than threshold - optional threshold for minimum accepted max value - if threshold is not used, initialization-free - — - wait-free CompareAndSwap mechanic Max returns current max and value-present flag - hasValue true indicates that value reflects a Value invocation - hasValue false: value is zero-value - Thread-safe Max1 returns current maximum whether zero-value or set by Value - threshold is ignored - Thread-safe Value updates the container with a possible max value - isNewMax is true if: - — value is equal to or greater than any threshold and - — invocation recorded the first 0 or - — a new max - upon return, Max and Max1 are guaranteed to reflect the invocation - the return order of concurrent Value invocations is not guaranteed - Thread-safe func NewAtomicMax() (atomicMax *AtomicMax)
AtomicMin is a thread-safe Min container - hasValue indicator true if a value was equal to or greater than threshold - optional threshold for minimum accepted Min value - — - wait-free CompareAndSwap mechanic Min returns current min and value-present flag - hasValue true indicates that value reflects a Value invocation - hasValue false: value is zero-value - Thread-safe Min1 returns current Minimum whether zero-value or set by Value - threshold is ignored - Thread-safe Value updates the container with a possible Min value - isNewMin is true if: - — value is equal to or greater than any threshold and - — invocation recorded the first 0 or - — a new Min - upon return, Min and Min1 are guaranteed to reflect the invocation - the return order of concurrent Value invocations is not guaranteed - Thread-safe func NewAtomicMin() (atomicMin *AtomicMin)
Package-Level Functions (total 12)
func Atoi(b []byte) (int, error)
BytesToString converts byte slice to string.
MustParseFloat is like ParseFloat but panics on parse errors.
NewAtomicMax returns a thread-safe max container - if threshold is not used, AtomicMax is initialization-free
NewAtomicMin returns a thread-safe Min container - if threshold is not used, AtomicMin is initialization-free
func ParseFloat(b []byte, bitSize int) (float64, error)
func ParseInt(b []byte, base int, bitSize int) (int64, error)
ParseFloat parses a Redis RESP3 float reply into a Go float64, handling "inf", "-inf", "nan" per Redis conventions.
func ParseUint(b []byte, base int, bitSize int) (uint64, error)
SafeIntToInt32 safely converts an int to int32, returning an error if overflow would occur.
StringToBytes converts string to byte slice.
Type Parameters: T: any