MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / InitMongoDB

Function InitMongoDB

ioc/mongo.go:10–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8)
9
10func InitMongoDB() *mongo.Client {
11 addr := viper.GetString("mongodb.addr")
12 client, err := mongo.Connect(context.Background(), options.Client().ApplyURI(addr))
13 if err != nil {
14 panic(err)
15 }
16 return client
17}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected