...

Package util

import "github.com/redis/go-redis/v9/internal/util"
Overview
Index

Overview ▾

func Atoi

func Atoi(b []byte) (int, error)

func BytesToString

func BytesToString(b []byte) string

BytesToString converts byte slice to string.

func MustParseFloat

func MustParseFloat(s string) float64

MustParseFloat is like ParseFloat but panics on parse errors.

func ParseFloat

func ParseFloat(b []byte, bitSize int) (float64, error)

func ParseInt

func ParseInt(b []byte, base int, bitSize int) (int64, error)

func ParseStringToFloat

func ParseStringToFloat(s string) (float64, error)

ParseFloat parses a Redis RESP3 float reply into a Go float64, handling "inf", "-inf", "nan" per Redis conventions.

func ParseUint

func ParseUint(b []byte, base int, bitSize int) (uint64, error)

func StringToBytes

func StringToBytes(s string) []byte

StringToBytes converts string to byte slice.

func ToPtr

func ToPtr[T any](v T) *T