diff --git a/db/db.go b/db/db.go index 0481fb5..f2fc21b 100644 --- a/db/db.go +++ b/db/db.go @@ -9,7 +9,6 @@ import ( "strconv" "github.com/pkg/errors" - bolt "go.etcd.io/bbolt" "gorm.io/driver/sqlite" "gorm.io/gorm" "gorm.io/gorm/clause" @@ -137,31 +136,3 @@ func (db *Db) getUser(userId int) (user *User, err error) { return } - -func getMapper(tx *bolt.Tx, userId int) (mapper *bolt.Bucket) { - mappers := tx.Bucket(MAPPERS) - if mappers == nil { - return nil - } - - mapper = mappers.Bucket([]byte(strconv.Itoa(userId))) - if mapper == nil { - return nil - } - - return -} - -func getMapperMut(tx *bolt.Tx, userId int) (mapper *bolt.Bucket, err error) { - mappers, err := tx.CreateBucketIfNotExists(MAPPERS) - if err != nil { - return - } - - mapper, err = mappers.CreateBucketIfNotExists([]byte(strconv.Itoa(userId))) - if err != nil { - return - } - - return -} diff --git a/go.mod b/go.mod index 017c385..6a4a391 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,6 @@ require ( github.com/gorilla/sessions v1.2.1 // indirect github.com/kofalt/go-memoize v0.0.0-20200917044458-9b55a8d73e1c github.com/pkg/errors v0.8.1 - go.etcd.io/bbolt v1.3.5 golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520 gorm.io/driver/sqlite v1.1.4 gorm.io/gorm v1.21.12 diff --git a/go.sum b/go.sum index fb0c528..cad058e 100644 --- a/go.sum +++ b/go.sum @@ -151,8 +151,6 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -177,7 +175,6 @@ golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190609082536-301114b31cce/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=