예제 #1
0
파일: db.go 프로젝트: C0rWin/fabric
// 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
파일: db.go 프로젝트: cayleydb/dgraph
// 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
}