0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-23 22:27:35 -05:00
zot/pkg/meta/boltdb/parameters.go
LaurentiuNiculae 28de980319
feat(refator): refactoring repodb into meta (#1626)
Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
2023-07-18 10:27:26 -07:00

23 lines
372 B
Go

package boltdb
import (
"path"
"time"
bolt "go.etcd.io/bbolt"
)
type DBParameters struct {
RootDir string
}
func GetBoltDriver(params DBParameters) (*bolt.DB, error) {
const perms = 0o600
boltDB, err := bolt.Open(path.Join(params.RootDir, "repo.db"), perms, &bolt.Options{Timeout: time.Second * 10})
if err != nil {
return nil, err
}
return boltDB, nil
}