Documentation ¶
Index ¶
- func ClientID(id string) lockerOption
- func Clientset(c kubernetes.Interface) lockerOption
- func CreateLease(create bool) lockerOption
- func InClusterConfig() lockerOption
- func Namespace(ns string) 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 Clientset ¶
func Clientset(c kubernetes.Interface) lockerOption
Clientset configures a custom Kubernetes Clientset
func CreateLease ¶ added in v0.2.0
func CreateLease(create bool) lockerOption
CreateLease specifies whether to create lease when it's absent.
func InClusterConfig ¶
func InClusterConfig() lockerOption
InClusterConfig 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 RetryWaitDuration ¶
RetryWaitDuration is the duration the Lock function will wait before retrying after failing to acquire the lock
Types ¶
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker implements the Locker interface using the kubernetes Lease resource
func (*Locker) Lock ¶
func (l *Locker) Lock()
Lock will block until the client is the holder of the Lease resource
func (*Locker) LockContext ¶ added in v0.2.0
LockContext will block until the client is the holder of the Lease resource
Click to show internal directories.
Click to hide internal directories.