locking

package
v8.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package locking provides functions for acquiring and releasing PostgreSQL advisory locks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireXact

func AcquireXact(tx *gorm.DB, lockKey string, opts ...Option) error

AcquireXact acquires a PostgreSQL transaction-level advisory lock. The caller is responsible for ensuring that a transaction is active, and that the lock is released after use.

Types

type Option

type Option func(*Options)

Option is a function that applies an option to an Options instance.

func WithRetry

func WithRetry(opts *backoff.Options) Option

WithRetry sets the retry options.

type Options

type Options struct {
	Retry *backoff.Options
}

Options represents the locking options.

Jump to

Keyboard shortcuts

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