dorm

package
v0.0.86 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTrans

func NewTrans(ctx context.Context, trans Trans) context.Context

Types

type ExecFunc

type ExecFunc = func(context.Context) error

ExecFunc is a function that can be executed within a transaction

type Trans

type Trans interface {
	Tx(ctx context.Context, fn func(context.Context) error) error
	InTx(ctx context.Context, fn func(tx Tx) error) error
}

Trans is a transaction wrapper

func FromContext

func FromContext(ctx context.Context) Trans

type Tx

type Tx interface {
	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

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