Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 456 Bytes

README.md

File metadata and controls

31 lines (25 loc) · 456 Bytes

waitfor-mongodb

MongoDB resource readiness assertion library

Quick start

package main

import (
	"context"
	"fmt"
	"github.com/go-waitfor/waitfor"
	"github.com/go-waitfor/waitfor-mongodb"
	"os"
)

func main() {
	runner := waitfor.New(mongodb.Use())

	err := runner.Test(
		context.Background(),
		[]string{"mongodb://user:[email protected]/my-db"},
		waitfor.WithAttempts(5),
	)

	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
}