mirror of
https://github.com/astaxie/beego.git
synced 2025-07-06 12:00:18 +00:00
update mod
This commit is contained in:
20
vendor/github.com/siddontang/ledisdb/store/rocksdb/cache.go
generated
vendored
Normal file
20
vendor/github.com/siddontang/ledisdb/store/rocksdb/cache.go
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// +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)
|
||||
}
|
Reference in New Issue
Block a user