examples

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package examples provides some common code for sqlh examples and tests.

Index

Constants

This section is empty.

Variables

View Source
var SentinalTime time.Time = time.Date(2006, 1, 2, 3, 4, 5, 7, time.Local)

SentinalTime is a set time value used to generate times.

Functions

func Connect

func Connect(e Example) (DB *sql.DB, err error)

Connect creates a sqlmock DB and configures it for the example.

Types

type Example

type Example int

Example is a specific example.

const (
	ExSimpleMapper Example = iota
	ExTags
	ExNestedStruct
	ExNestedTwice
	ExScalar
	ExScalarSlice
	ExStruct
	ExStructNotFound
)

type TimeGenerator added in v0.5.0

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

TimeGenerator uses SentinalTime to return deterministic time values.

func (*TimeGenerator) Next added in v0.5.0

func (tg *TimeGenerator) Next() time.Time

Next returns the next time.Time.

Jump to

Keyboard shortcuts

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