Set is used to store key/value pair
(key []byte, val []byte)
| 108 | |
| 109 | // Set is used to store key/value pair |
| 110 | func (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 |
| 122 | func (fds *FlyDbStore) Get(key []byte) ([]byte, error) { |