func ReplaceData() LockOption {
	return func(l *Lock) {
		l.replaceData = true
	}
}
ReplaceData will force the new content to be stored in the lock entry.
package pglock
import (
	"context"
	"sync"
	"time"
)
const lockMaxLogLines = 50
type Lock struct {
	client           *Client
	name             string
	owner            string
	heartbeatWG      sync.WaitGroup
	heartbeatContext context.Context
	heartbeatCancel  context.CancelFunc
	leaseDuration    time.Duration
	replaceData   bool
	data          []byte
	failIfLocked  bool
	keepOnRelease bool
	mu                  sync.Mutex
	isReleased          bool
	recordVersionNumber int64
}
func (l *Lock) Data() []byte {
	return l.data
}
func (l *Lock) Close() error {
	return l.client.Release(l)
}
func (l *Lock) IsReleased() bool {
	l.mu.Lock()
	defer l.mu.Unlock()
	return l.isReleased
}
func (l *Lock) Owner() string {
	l.mu.Lock()
	defer l.mu.Unlock()
	return l.owner
}
func (l *Lock) RecordVersionNumber() int64 {
	l.mu.Lock()
	defer l.mu.Unlock()
	return l.recordVersionNumber
}
type LockOption func(*Lock)
func WithCustomHeartbeatContext(ctx context.Context) LockOption {
	return func(l *Lock) {
		l.heartbeatContext, l.heartbeatCancel = context.WithCancel(ctx)
	}
}
func FailIfLocked() LockOption {
	return func(l *Lock) {
		l.failIfLocked = true
	}
}
func WithData(data []byte) LockOption {
	return func(l *Lock) {
		l.data = data
	}
}
func KeepOnRelease() LockOption {
	return func(l *Lock) {
		l.keepOnRelease = true
	}
}