🚀 feature: add bbolt implementation (#321)

* Update CI/CD tests.

* Add Bbolt db.

* Add README.

* Add actions.

* Drop go1.14 & go1.15 for bbolt.

* Add support for go1.16

* Update config.go

Co-authored-by: wernerr <rene.werner@verivox.com>
This commit is contained in:
M. Efe Çetin
2022-02-10 17:45:13 +03:00
committed by GitHub
parent 315f14ce58
commit cc5ccf062b
11 changed files with 436 additions and 1 deletions

20
bbolt/utils.go Normal file
View File

@@ -0,0 +1,20 @@
package bbolt
import (
"github.com/gofiber/utils"
"go.etcd.io/bbolt"
)
func createBucket(cfg Config, conn *bbolt.DB) error {
return conn.Update(func(tx *bbolt.Tx) error {
_, err := tx.CreateBucketIfNotExists(utils.UnsafeBytes(cfg.Bucket))
return err
})
}
func removeBucket(cfg Config, conn *bbolt.DB) error {
return conn.Update(func(tx *bbolt.Tx) error {
return tx.DeleteBucket(utils.UnsafeBytes(cfg.Bucket))
})
}