drivers

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package drivers contains instruments for drivers.

Index

Constants

This section is empty.

Variables

View Source
var ErrRollbackTr = errors.New("rollback")

ErrRollbackTr is used to rollback transaction, which runs in closure.

Functions

This section is empty.

Types

type IsClosed

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

IsClosed stores the state of the trm.Transaction.

func NewIsClosed

func NewIsClosed() *IsClosed

NewIsClosed creates a new IsClosed.

func (*IsClosed) Close

func (a *IsClosed) Close()

Close closes the channel.

func (*IsClosed) CloseWithCause

func (a *IsClosed) CloseWithCause(err error)

CloseWithCause closes the channel and stores error from transaction commit or rollback.

func (*IsClosed) Closed

func (a *IsClosed) Closed() <-chan struct{}

Closed returns a channel that's closed when trm.Transaction done. Closed is provided for use in select statements.

func (*IsClosed) Err

func (a *IsClosed) Err() error

Err is inspired function Err in https://pkg.go.dev/context#Context

func (*IsClosed) IsActive

func (a *IsClosed) IsActive() bool

IsActive returns true if the channel is open.

func (*IsClosed) IsClosed

func (a *IsClosed) IsClosed() bool

IsClosed returns true if the channel is closed.

Jump to

Keyboard shortcuts

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