postgres

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-postgres

Postgres resource readiness assertion library

Quick start

package main

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

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

	err := runner.Test(
		context.Background(),
		[]string{"postgres://localhost:8080/my-db"},
		waitfor.WithAttempts(5),
	)

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

Documentation

Index

Constants

View Source
const Scheme = "postgres"

Variables

This section is empty.

Functions

func New

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

func Use

func Use() waitfor.ResourceConfig

Types

type Postgres

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

func (*Postgres) Test

func (s *Postgres) Test(ctx context.Context) error

Jump to

Keyboard shortcuts

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