Пример #1
0
// GetProperty returns the value of a database property.
func (db *DB) GetProperty(propName string) string {
	cprop := C.CString(propName)
	defer C.free(unsafe.Pointer(cprop))
	cValue := C.rocksdb_property_value(db.c, cprop)
	defer C.free(unsafe.Pointer(cValue))
	return C.GoString(cValue)
}
Пример #2
0
// PropertyValue returns the value of a database property.
//
// Examples of properties include "rocksdb.stats", "rocksdb.sstables",
// and "rocksdb.num-files-at-level0".
func (db *DB) PropertyValue(propName string) string {
	cname := C.CString(propName)
	value := C.GoString(C.rocksdb_property_value(db.Ldb, cname))
	C.free(unsafe.Pointer(cname))
	return value
}