1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-06 01:40:55 +00:00
Beego/vendor/github.com/siddontang/ledisdb/store/rocksdb/env.go

28 lines
518 B
Go
Raw Normal View History

2018-11-09 04:37:28 +00:00
// +build rocksdb
package rocksdb
// #cgo LDFLAGS: -lrocksdb
// #include "rocksdb/c.h"
import "C"
type Env struct {
Env *C.rocksdb_env_t
}
func NewDefaultEnv() *Env {
return &Env{C.rocksdb_create_default_env()}
}
func (env *Env) SetHighPriorityBackgroundThreads(n int) {
C.rocksdb_env_set_high_priority_background_threads(env.Env, C.int(n))
}
func (env *Env) SetBackgroundThreads(n int) {
C.rocksdb_env_set_background_threads(env.Env, C.int(n))
}
func (env *Env) Close() {
C.rocksdb_env_destroy(env.Env)
}