23 lines
611 B
Go
23 lines
611 B
Go
|
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
|
||
|
}
|