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

Method Exists

structure/string.go:338–349  ·  view source on GitHub ↗

Exists checks if a key exists

(key string)

Source from the content-addressed store, hash-verified

336
337// Exists checks if a key exists
338func (s *StringStructure) Exists(key string) (bool, error) {
339 // Get the value
340 _, err := s.Get(key)
341 if err != nil {
342 if err == _const.ErrKeyNotFound {
343 return false, nil
344 }
345 return false, err
346 }
347
348 return true, nil
349}
350
351// Expire sets the expiration time of a key
352func (s *StringStructure) Expire(key string, ttl int64) error {

Callers 1

MSetNXMethod · 0.95

Calls 1

GetMethod · 0.95

Tested by

no test coverage detected