MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / Expire

Method Expire

structure/string.go:352–361  ·  view source on GitHub ↗

Expire sets the expiration time of a key

(key string, ttl int64)

Source from the content-addressed store, hash-verified

350
351// Expire sets the expiration time of a key
352func (s *StringStructure) Expire(key string, ttl int64) error {
353 // Get the value
354 oldValue, err := s.Get(key)
355 if err != nil {
356 return err
357 }
358
359 // Set the value
360 return s.Set(key, oldValue, ttl)
361}
362
363// Persist removes the expiration time of a key
364func (s *StringStructure) Persist(key string) error {

Callers

nothing calls this directly

Calls 2

GetMethod · 0.95
SetMethod · 0.95

Tested by

no test coverage detected