mongodb

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

README

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:passsword@my-server.net/my-db"},
		waitfor.WithAttempts(5),
	)

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

Documentation

Index

Constants

View Source
const Scheme = "mongodb"

Variables

This section is empty.

Functions

func New

func New(u *url.URL) (waitfor.Resource, error)

func Use

func Use() waitfor.ResourceConfig

Types

type Mongo

type Mongo struct {
	// contains filtered or unexported fields
}

func (*Mongo) Test

func (m *Mongo) Test(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL