1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-18 06:30:56 +00:00
Beego/vendor/github.com/siddontang/ledisdb/store/rocksdb/cache.go
2018-07-30 12:05:51 +08:00

21 lines
341 B
Go

// +build rocksdb
package rocksdb
// #cgo LDFLAGS: -lrocksdb
// #include <stdint.h>
// #include "rocksdb/c.h"
import "C"
type Cache struct {
Cache *C.rocksdb_cache_t
}
func NewLRUCache(capacity int) *Cache {
return &Cache{C.rocksdb_cache_create_lru(C.size_t(capacity))}
}
func (c *Cache) Close() {
C.rocksdb_cache_destroy(c.Cache)
}