middlewares

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoOpLocker = LockerFn(func(ctx context.Context, name string) (Unlock, error) {
	return func(ctx context.Context) {}, nil
})

Functions

func Log added in v1.0.4

func Log() gin.HandlerFunc

func Transaction added in v1.8.0

func Transaction(locker Locker) func(c *gin.Context)

Types

type InMemoryLocker added in v1.8.1

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

func NewInMemoryLocker added in v1.8.1

func NewInMemoryLocker() *InMemoryLocker

func (*InMemoryLocker) Lock added in v1.8.1

func (d *InMemoryLocker) Lock(ctx context.Context, ledger string) (Unlock, error)

type LedgerMiddleware

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

func NewLedgerMiddleware

func NewLedgerMiddleware(resolver *ledger.Resolver) LedgerMiddleware

func (*LedgerMiddleware) LedgerMiddleware

func (m *LedgerMiddleware) LedgerMiddleware() gin.HandlerFunc

type Locker added in v1.8.1

type Locker interface {
	Lock(ctx context.Context, name string) (Unlock, error)
}

type LockerFn added in v1.8.1

type LockerFn func(ctx context.Context, name string) (Unlock, error)

func (LockerFn) Lock added in v1.8.1

func (fn LockerFn) Lock(ctx context.Context, name string) (Unlock, error)

type Unlock added in v1.8.1

type Unlock func(ctx context.Context)

Jump to

Keyboard shortcuts

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