datastoretest

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package datastoretest provides testing helper functions for the datastore package. I am intentionally repeating functions that are in datastore here as I want different versions as helpers with less logging

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB added in v0.23.0

func NewDB(t *testing.T) (db *sql.DB, cleanup func())

NewDB provides a sql.DB and cleanup function for testing. The following environment variables must be set to connect to the DB.

DB Host     = DB_HOST
Port        = DB_PORT
DB Name     = DB_NAME
DB User     = DB_USER
DB Password = DB_PASSWORD

func NewDefaultDatastore added in v0.25.0

func NewDefaultDatastore(t *testing.T, lgr zerolog.Logger) (datastore.DefaultDatastore, func())

NewDefaultDatastore provides a datastore.DefaultDatastore struct initialized with a sql.DB and cleanup function for testing. The following environment variables must be set to connect to the DB.

DB Host     = DB_HOST
Port        = DB_PORT
DB Name     = DB_NAME
DB User     = DB_USER
DB Password = DB_PASSWORD

Types

This section is empty.

Jump to

Keyboard shortcuts

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