MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / cmdEXPIREAT

Function cmdEXPIREAT

strings.go:69–80  ·  view source on GitHub ↗

cmdEXPIREAT sets an expiration timestamp for a key.

(m uhaha.Machine, args []string)

Source from the content-addressed store, hash-verified

67}
68
69// cmdEXPIREAT sets an expiration timestamp for a key.
70func cmdEXPIREAT(m uhaha.Machine, args []string) (interface{}, error) {
71 if len(args) != 3 {
72 return nil, uhaha.ErrWrongNumArgs
73 }
74
75 timestamp, err := ledis.StrInt64([]byte(args[2]), nil)
76 if err != nil {
77 return nil, fmt.Errorf("ERR invalid timestamp: %v", err)
78 }
79
80 return handleExpiration([]byte(args[1]), timestamp)
81}
82
83// cmdEXPIRE sets an expiration time for a key.

Callers

nothing calls this directly

Calls 1

handleExpirationFunction · 0.85

Tested by

no test coverage detected