Close closes the database instances
()
| 135 | |
| 136 | // Close closes the database instances |
| 137 | func (db *DB) Close() error { |
| 138 | // Close the leveldb instance |
| 139 | if err := db.leveldb.Close(); err != nil { |
| 140 | return fmt.Errorf("failed to close leveldb: %w", err) |
| 141 | } |
| 142 | // Close the LevelKVDB instance (assuming it doesn't return an error) |
| 143 | db.db.Close() |
| 144 | return nil |
| 145 | } |
| 146 | |
| 147 | // Put inserts a key-value pair into the database |
| 148 | func (db *DB) Put(key, value []byte) error { |