txn

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustBeIn

func MustBeIn(m State)

Types

type Mgr

type Mgr interface {
	// New creates a new State object, for the purposes of executing
	// queries within a single context.
	New() State
}

Mgr manages the initialisation of transaction state objects. Mgr instances may exist in multiple goroutines.

type State

type State interface {
	WithTxn(fn func() error) error
	InTxn() bool
	ResetTxn() error
}

State represents the transaction state for a single request. A State object instance should exist only within a single goroutine. It MUST NOT be shared between goroutines.

Jump to

Keyboard shortcuts

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