mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-12-05 02:19:00 +08:00
19 lines
330 B
Go
19 lines
330 B
Go
|
package cache
|
||
|
|
||
|
import (
|
||
|
"github.com/1Panel-dev/1Panel/global"
|
||
|
"github.com/1Panel-dev/1Panel/init/cache/badger_db"
|
||
|
"github.com/dgraph-io/badger/v3"
|
||
|
)
|
||
|
|
||
|
func Init() {
|
||
|
c := global.CONF.Cache
|
||
|
|
||
|
cache, err := badger.Open(badger.DefaultOptions(c.Path))
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
|
||
|
global.CACHE = badger_db.NewCacheDB(cache)
|
||
|
}
|