library-go/mongo/const.go

22 lines
523 B
Go
Raw Permalink Normal View History

2024-12-24 09:32:18 +00:00
package mongo
import (
"github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/core/syncx"
"go.mongodb.org/mongo-driver/mongo"
)
const (
authenticationStringTemplate = "%s:%s@"
connectionStringTemplate = "%s://%s%s"
)
var (
// ErrNotFound is an alias of mongo.ErrNoDocuments.
ErrNotFound = mongo.ErrNoDocuments
// can't use one SingleFlight per conn, because multiple conns may share the same cache key.
singleFlight = syncx.NewSingleFlight()
stats = cache.NewStat("monc")
)