common/mongo/config.go

23 lines
611 B
Go
Raw Normal View History

2024-02-02 12:02:44 +00:00
package mongo
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
type Configuration struct {
Host string `env:"MONGO_HOST,default=localhost"`
Port string `env:"MONGO_PORT,default=27017"`
User string `env:"MONGO_USER,required"`
Password string `env:"MONGO_PASSWORD,required"`
Auth string `env:"MONGO_AUTH,required"`
DatabaseName string `env:"MONGO_DB_NAME,required"`
}
type RequestSettings struct {
Driver *mongo.Collection
Options *options.FindOptions
Filter primitive.M
}