Documentation ¶
Index ¶
- func ClientID(id string) lockerOption
- func Context(ctx context.Context) lockerOption
- func InClusterClient() lockerOption
- func K8sClient(c client.Client) lockerOption
- func Namespace(ns string) lockerOption
- func OwnerRef(ownerRef *metav1.OwnerReference) lockerOption
- func RetryWaitDuration(d time.Duration) lockerOption
- func TTL(ttl time.Duration) lockerOption
- type Locker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientID ¶
func ClientID(id string) lockerOption
ClientID is a unique ID for the client acquiring the lock
func InClusterClient ¶
func InClusterClient() lockerOption
InClusterClient configures the Kubernetes client assuming it is running inside a pod
func Namespace ¶
func Namespace(ns string) lockerOption
Namespace is the namespace used to store the Lease
func OwnerRef ¶
func OwnerRef(ownerRef *metav1.OwnerReference) lockerOption
OwnerRef is the OwnerReference to set on the Lease. This is useful if you want to delete the Lease when the owner is deleted.
func RetryWaitDuration ¶
RetryWaitDuration is the duration the Lock function will wait before retrying after failing to acquire the lock, defaults to 100 milliseconds
Types ¶
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker implements the Locker interface using the kubernetes Lease resource
Click to show internal directories.
Click to hide internal directories.