dbrtest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dbrtest provides objects and helpers for writings tests for code that uses dbr and dbrutils packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockTxRunner

type MockTxRunner struct {
	Err           error
	Tx            *dbr.Tx
	BeginTxCalled int
	DoInTxCalled  int
}

MockTxRunner is a mock that implements dbrutils.TxRunner interface.

func (*MockTxRunner) BeginTx

func (m *MockTxRunner) BeginTx(ctx context.Context) (*dbr.Tx, error)

BeginTx returns error or dbr.Tx object.

func (*MockTxRunner) DoInTx

func (m *MockTxRunner) DoInTx(ctx context.Context, fn func(dbRunner dbr.SessionRunner) error) error

DoInTx returns error or calls passed callback.

Jump to

Keyboard shortcuts

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