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

Method setExpireToDB

structure/expiring_key.go:162–170  ·  view source on GitHub ↗

setExpireToDB stores the data into the database.

(key string, deadtime int64)

Source from the content-addressed store, hash-verified

160
161// setExpireToDB stores the data into the database.
162func (ek *ExpireStructure) setExpireToDB(key string, deadtime int64) error {
163 // Serialize into binary array
164 encValue, err := ek.encodeExpire(deadtime)
165 if err != nil {
166 return err
167 }
168 // Store in the database
169 return ek.db.Put([]byte(key), encValue)
170}
171
172// encodeExpire encodes the value
173// format: [type][data]

Callers 9

EXPIREMethod · 0.95
PEXPIREMethod · 0.95
EXPIREATMethod · 0.95
PEXPIREATMethod · 0.95
PERSISTMethod · 0.95
EXPIREBYMethod · 0.95
PEXPIREBYMethod · 0.95
EXPIREBYATMethod · 0.95
PEXPIREBYATMethod · 0.95

Calls 2

encodeExpireMethod · 0.95
PutMethod · 0.65

Tested by

no test coverage detected