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

Method Set

lib/datastore/flydb.go:110–119  ·  view source on GitHub ↗

Set is used to store key/value pair

(key []byte, val []byte)

Source from the content-addressed store, hash-verified

108
109// Set is used to store key/value pair
110func (fds *FlyDbStore) Set(key []byte, val []byte) error {
111 if len(key) == 0 {
112 return _const.ErrKeyIsEmpty
113 }
114 err := fds.conn.Put(key, val)
115 if err != nil {
116 return err
117 }
118 return nil
119}
120
121// Get retrieves the value associated with `key`; returns []byte if key exists
122func (fds *FlyDbStore) Get(key []byte) ([]byte, error) {

Callers

nothing calls this directly

Calls 1

PutMethod · 0.65

Tested by

no test coverage detected