Documentation
¶
Overview ¶
Package transactional provides sqlx transactional wrappers for http handlers and functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerFunc ¶
HandlerFunc is Handler function.
func (HandlerFunc) ServeHTTP ¶
func (f HandlerFunc) ServeHTTP(tx *sqlx.Tx, w http.ResponseWriter, r *http.Request) error
ServeHTTP satisfies Handler.
type Transactional ¶
type Transactional struct {
// contains filtered or unexported fields
}
Transactional can wrap functions and http handlers within a transaction.
func WithDB ¶
func WithDB(db *sqlx.DB) *Transactional
WithDB creates a new transactional using the given db.
func (*Transactional) Wrap ¶
func (t *Transactional) Wrap(h Handler, eh httperr.ErrorHandler) http.Handler
Wrap wraps the given http handler within a transaction.
func (*Transactional) WrapF ¶
func (t *Transactional) WrapF(h HandlerFunc, eh httperr.ErrorHandler) http.Handler
WrapF wraps the given http handler func within a transaction.
type Typed ¶
type Typed[T any] struct { // contains filtered or unexported fields }
Typed can wrap functions into transactions.
func WithDBAndType ¶
WithDBAndType() creates a new Typed using the given db and type.
Click to show internal directories.
Click to hide internal directories.