Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitCredentials ¶
GitCredentials are unique to the user and workspace.
func (GitCredentials) GetLockId ¶
func (g GitCredentials) GetLockId() string
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
Lock is a lock that is acquired by a single test. Locks can be acquired by calling the Acquire() method on a LockOptions struct. The lock is released when the Unlock() method is called. Failures to acquire the lock in time, to renew the leease, or to release the lock will cause the test to fail.
func Acquire ¶
Acquire acquires a lock according to the provided lock options. If successful, the lock is returned. The caller is responsible for calling the Unlock() method on the returned lock when the lock is no longer needed. If the lock is held at the moment Acquire() is called, the method will block for up to the lease duration, retrying periodically to acquire the lock. If the lock is not acquired in time, an error will be returned.
When the lock is no longer needed, the caller should call the Unlock() method on the returned lock. This will release the lock and return any errors that occurred while releasing the lock. If a *testing.T is provided as a LockOption, the Unlock() method will be called automatically when the test completes.
By default, the lock will be acquired for 1 minute. This can be changed by passing the WithLeaseDuration() LockOption.
By default, the lock will be acquired using a Databricks backend. This can be changed by passing the WithBackend() LockOption.
type LockOption ¶
type LockOption func(*LockOptions)
func InTest ¶
func InTest(t *testing.T) LockOption
func WithBackend ¶
func WithBackend(backend core.LockBackend) LockOption
func WithLeaseDuration ¶
func WithLeaseDuration(duration time.Duration) LockOption
type LockOptions ¶
type LockableImpl ¶
type LockableImpl[R any] struct { // contains filtered or unexported fields }
LockableImpl is a default implementation of Lockable. If r is a struct, it uses reflection to generate a unique lock ID based on the name and fields of the struct. If r is a string, it uses the string as the lock ID.
func NewLockable ¶
func NewLockable[R any](r R) LockableImpl[R]
func (LockableImpl[R]) GetLockId ¶
func (l LockableImpl[R]) GetLockId() string