hscan
v9.24.1
github.com/redis/go-redis/v9/internal/hscan
Documentation
pkg.go.dev ↗Functions
JoinErrors
func JoinErrors(errs []error) error
JoinErrors returns nil for no errors, the error itself for one, and errors.Join of all of them for several. A single field error keeps its value and text; several stay reachable through errors.Is and errors.As.
Scan
func Scan(dst interface{}, keys []interface{}, vals []interface{}) error
Scan scans the results from a key-value Redis map result set to a destination struct. The Redis keys are matched to the struct's field with the `redis` tag. If a field fails to decode, Scan still sets every other field it can. One failing field returns its error as is; several return them joined with errors.Join in key order, so errors.Is and errors.As match any of them.
Types
Scanner
type Scanner interface {
ScanRedis(s string) error
}
Scanner is the interface implemented by themselves, which will override the decoding behavior of decoderFunc.
StructValue
type StructValue struct {
// contains filtered or unexported fields
}
Struct
func Struct(dst interface{}) (StructValue, error)
StructValue.Scan
func (s StructValue) Scan(key string, value string) error