txlock

package
v0.68.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package txlock provides transaction-scoped PostgreSQL advisory locks shared by persistence packages without creating internal package import cycles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdvisoryXactLock

func AdvisoryXactLock(ctx context.Context, tx pgx.Tx, key string) error

AdvisoryXactLock acquires a PostgreSQL transaction-scoped advisory lock keyed by an arbitrary string. Concurrent transactions that request the same key run serially; transactions with different keys are unaffected.

func AgentAssignmentLockKey

func AgentAssignmentLockKey(userID, agentID string) string

AgentAssignmentLockKey identifies one user's assignment to one Agent. Scope transitions that create the assignment and administrative revocations must use this exact key, otherwise a revoke can commit between their writes and be silently undone by the transition.

Types

This section is empty.

Jump to

Keyboard shortcuts

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