Compare commits

..

No commits in common. "main" and "mongo/v0.0.6" have entirely different histories.

4 changed files with 6 additions and 5 deletions

View File

@ -7,6 +7,7 @@ type Conf struct {
User string
Password string
Host string
Port string
Database string
ReplicaName string
MaxStaleness time.Duration

View File

@ -15,8 +15,8 @@ type DocumentDBWithCache struct {
Cache cache.Cache
}
func MustDocumentDBWithCache(conf *Conf, collection string, cacheConf cache.CacheConf, dbOpts []mon.Option, cacheOpts []cache.Option) (DocumentDBWithCacheUseCase, error) {
documentDB, err := NewDocumentDB(conf, collection, dbOpts...)
func MustDocumentDBWithCache(conf *Conf, cacheConf cache.CacheConf, dbOpts []mon.Option, cacheOpts []cache.Option) (DocumentDBWithCacheUseCase, error) {
documentDB, err := NewDocumentDB(conf, dbOpts...)
if err != nil {
return nil, fmt.Errorf("failed to initialize DocumentDB: %w", err)
}

View File

@ -20,7 +20,7 @@ type DocumentDB struct {
Mon *mon.Model
}
func NewDocumentDB(config *Conf, collection string, opts ...mon.Option) (DocumentDBUseCase, error) {
func NewDocumentDB(config *Conf, opts ...mon.Option) (DocumentDBUseCase, error) {
authenticationURI := ""
if config.User != "" {
authenticationURI = fmt.Sprintf(
@ -50,7 +50,7 @@ func NewDocumentDB(config *Conf, collection string, opts ...mon.Option) (Documen
opts = append(opts, intOpt)
logx.Infof("[DocumentDB] Try to connect document db `%s`", printConnectUri)
client, err := mon.NewModel(connectionURI, config.Database, collection, opts...)
client, err := mon.NewModel(connectionURI, config.Database, config.Database, opts...)
if err != nil {
return nil, err
}

View File

@ -2,7 +2,7 @@ package invited_code
const (
DefaultCodeLen = 8
InitAutoID = 10000000
InitAutoId = 10000000
)
var ConvertTable = []string{