Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
TableName string
LockID int64
LeaseDuration time.Duration
HeartbeatInterval time.Duration
LockTimeout ProbeConfig
UnlockTimeout ProbeConfig
// Optional logger for lock operations
Logger *slog.Logger
// Optional custom retry policy for database errors
RetryPolicy RetryPolicyFunc
}
Config holds configuration for table locker.
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker implements table-based locking for databases. This implementation is safe for concurrent use by multiple goroutines.
type ProbeConfig ¶
ProbeConfig holds retry configuration.
type RetryPolicyFunc ¶
RetryPolicyFunc inspects an error and returns whether the caller should retry the operation. This allows for database-specific error handling without hardcoding driver-specific logic.
Click to show internal directories.
Click to hide internal directories.