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

Method setListToDB

structure/list.go:612–620  ·  view source on GitHub ↗

setListToDB stores the data into the database.

(key string, lst *list, ttl time.Duration)

Source from the content-addressed store, hash-verified

610
611// setListToDB stores the data into the database.
612func (l *ListStructure) setListToDB(key string, lst *list, ttl time.Duration) error {
613 // Serialize into binary array
614 encValue, err := l.encodeList(lst, ttl)
615 if err != nil {
616 return err
617 }
618 // Store in the database
619 return l.db.Put([]byte(key), encValue)
620}
621
622// encodeList encodes the value
623// format: [type][data]

Callers 10

LPushMethod · 0.95
LPushsMethod · 0.95
RPushMethod · 0.95
RPushsMethod · 0.95
LPopMethod · 0.95
RPopMethod · 0.95
LRemMethod · 0.95
LSetMethod · 0.95
LTrimMethod · 0.95
RPOPLPUSHMethod · 0.95

Calls 2

encodeListMethod · 0.95
PutMethod · 0.65

Tested by

no test coverage detected