MCPcopy
hub / github.com/redis/go-redis / HPExpire

Method HPExpire

hash_commands.go:296–305  ·  view source on GitHub ↗

HPExpire - Sets the expiration time for specified fields in a hash in milliseconds. Similar to HExpire, it accepts a key, an expiration duration in milliseconds, a struct with expiration condition flags, and a list of fields. The command modifies the standard time.Duration to milliseconds for the Re

(ctx context.Context, key string, expiration time.Duration, fields ...string)

Source from the content-addressed store, hash-verified

294//
295// [HPEXPIRE Documentation]: https://redis.io/commands/hpexpire/
296func (c cmdable) HPExpire(ctx context.Context, key string, expiration time.Duration, fields ...string) *IntSliceCmd {
297 args := []interface{}{"HPEXPIRE", key, formatMs(ctx, expiration), "FIELDS", len(fields)}
298
299 for _, field := range fields {
300 args = append(args, field)
301 }
302 cmd := NewIntSliceCmd(ctx, args...)
303 _ = c(ctx, cmd)
304 return cmd
305}
306
307// HPExpireWithArgs - Sets the expiration time for specified fields in a hash in milliseconds.
308// It requires a key, an expiration duration, a struct with boolean flags for conditional expiration settings (NX, XX, GT, LT), and a list of fields.

Callers

nothing calls this directly

Calls 2

formatMsFunction · 0.85
NewIntSliceCmdFunction · 0.85

Tested by

no test coverage detected