Help us shape the future of Go! Take the 2026 Go Developer Survey

transaction

package
v2.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package transaction implements a transaction middleware for REST endpoints using the ent db client

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrProcessingRequest is returned when the request cannot be processed
	ErrProcessingRequest = errors.New("error processing request, please try again")
)

Functions

func FromContext

func FromContext(ctx context.Context) *ent.Tx

FromContext returns a TX Client stored inside a context, or nil if there isn't one

func NewContext

func NewContext(parent context.Context, c *ent.Tx) context.Context

NewContext returns a new context with the given TX Client attached

Types

type Client

type Client struct {
	EntDBClient *ent.Client
}

func (*Client) Middleware

func (d *Client) Middleware(next echo.HandlerFunc) echo.HandlerFunc

Middleware returns a middleware function for transactions on REST endpoints

Jump to

Keyboard shortcuts

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