22 lines
523 B
Go
22 lines
523 B
Go
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")
|
|
)
|