Created
August 30, 2021 08:02
-
-
Save percybolmer/72f1e84d4da41687062f7f03f91ceae4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func WithMongoCustomerRepository(connectionString string) OrderConfiguration { | |
return func(os *OrderService) error { | |
// Create the mongo repo, if we needed parameters, such as connection strings they could be inputted here | |
cr, err := mongo.New(context.Background(), connectionString) | |
if err != nil { | |
return err | |
} | |
os.customers = cr | |
return nil | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment