lockrank

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package lockrank provides request-local, test-observable enforcement of the cross-database lock order. It never grants a lock itself; it proves that a caller cannot acquire a lower-ranked capability while retaining a higher one.

Index

Constants

This section is empty.

Variables

View Source
var ErrReverseOrder = errors.New("lock rank reverse order")

Functions

func WithTracker

func WithTracker(ctx context.Context) context.Context

Types

type Lease

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

func Acquire

func Acquire(ctx context.Context, rank Rank) (*Lease, error)

func (*Lease) Release

func (lease *Lease) Release()

type Rank

type Rank uint8
const (
	Control  Rank = 10
	Business Rank = 20
)

Jump to

Keyboard shortcuts

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