forked from tecbot/gorocksdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcf_handle.go
More file actions
26 lines (21 loc) · 751 Bytes
/
cf_handle.go
File metadata and controls
26 lines (21 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package gorocksdb
// #include <stdlib.h>
// #include "rocksdb/c.h"
import "C"
import "unsafe"
// ColumnFamilyHandle represents a handle to a ColumnFamily.
type ColumnFamilyHandle struct {
c *C.rocksdb_column_family_handle_t
}
// NewNativeColumnFamilyHandle creates a ColumnFamilyHandle object.
func NewNativeColumnFamilyHandle(c *C.rocksdb_column_family_handle_t) *ColumnFamilyHandle {
return &ColumnFamilyHandle{c}
}
// UnsafeGetCFHandler returns the underlying c column family handle.
func (h *ColumnFamilyHandle) UnsafeGetCFHandler() unsafe.Pointer {
return unsafe.Pointer(h.c)
}
// Destroy calls the destructor of the underlying column family handle.
func (h *ColumnFamilyHandle) Destroy() {
C.rocksdb_column_family_handle_destroy(h.c)
}