Skip to content

Commit

Permalink
Use badger as default in docdb; update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Dec 6, 2024
1 parent 9783700 commit f0cebfb
Show file tree
Hide file tree
Showing 5 changed files with 235 additions and 70 deletions.
4 changes: 2 additions & 2 deletions docdb/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package docdb

import (
srvConfig "github.com/CHESSComputing/golib/config"
embed "github.com/CHESSComputing/golib/embed"
embed "github.com/CHESSComputing/golib/embed/badger"
"github.com/CHESSComputing/golib/mongo"
)

Expand All @@ -29,7 +29,7 @@ func Upsert(dbname, collname, attr string, records []map[string]any) error {
// Get records from document-oriented db
func Get(dbname, collname string, spec map[string]any, idx, limit int) []map[string]any {
if srvConfig.Config.Embed.DocDb != "" {
embed.Get(dbname, collname, spec, idx, limit)
return embed.Get(dbname, collname, spec, idx, limit)
}
return mongo.Get(dbname, collname, spec, idx, limit)
}
Expand Down
53 changes: 0 additions & 53 deletions embed/main.go

This file was deleted.

28 changes: 23 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.23.4
require (
github.com/HouzuoGuo/tiedot v0.0.0-20210905174726-ae1e16866d06
github.com/dchest/captcha v1.0.0
github.com/dgraph-io/badger/v4 v4.5.0
github.com/gin-contrib/sessions v1.0.1
github.com/gin-gonic/gin v1.10.0
github.com/glebarez/go-sqlite v1.22.0
Expand All @@ -17,6 +18,7 @@ require (
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
github.com/materials-commons/gomcapi v0.0.5
github.com/mattn/go-sqlite3 v1.14.24
github.com/ostafen/clover/v2 v2.0.0-alpha.3
github.com/pascaldekloe/jwt v1.12.0
github.com/prometheus/procfs v0.15.1
github.com/rs/xid v1.6.0
Expand All @@ -39,8 +41,13 @@ require (
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/dgraph-io/badger/v3 v3.2103.2 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dgraph-io/ristretto/v2 v2.0.0 // indirect
github.com/dmotylev/goproperties v0.0.0-20140630191356-7cbffbaada47 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
Expand All @@ -53,7 +60,13 @@ require (
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/go-resty/resty/v2 v2.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/flatbuffers v24.3.25+incompatible // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/gorilla/context v1.1.2 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/gorilla/sessions v1.2.2 // indirect
Expand All @@ -65,7 +78,7 @@ require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lestrrat-go/strftime v1.0.5 // indirect
Expand All @@ -82,6 +95,7 @@ require (
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/satori/go.uuid v1.2.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
Expand All @@ -91,18 +105,22 @@ require (
github.com/tklauser/numcpus v0.8.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/jcmturner/aescts.v1 v1.0.1 // indirect
Expand Down
Loading

0 comments on commit f0cebfb

Please sign in to comment.