// InitUsers inits user required modules
InitUsers inits user required modules
// InitUsers inits user required modules
func (ur *UserMongoRepository) InitUsers() {
	if !database.IsConnectionDone {
		if err := database.InitDatabaseConnection(); err != nil {
			panic(err.Error())
		}
	}
	index := mgo.Index{
		Key:        []string{"username", "email"},
		Unique:     true,
		DropDups:   true,
		Background: true,
		Sparse:     true,
	}
	err := ur.Collection.EnsureIndex(index)
	if err != nil {
		panic(err)
	}
}
func ( ur * UserMongoRepository ) InitUsers ( ) { if ! database . IsConnectionDone { if err := database . InitDatabaseConnection ( ) ; err != nil { panic ( err . Error ( ) ) } } index := mgo . Index { Key : [ ] string { " " , " " } , Unique : true , DropDups : true , Background : true , Sparse : true , } err := ur . Collection . EnsureIndex ( index ) if err != nil { panic ( err ) } }
InitUsers inits user required modules
InitUsers inits user required modules