Documentation ¶
Index ¶
- func DefaultEventHandler(ctx context.Context, echan chan Event)
- func GetKubeConfig() *rest.Config
- type AcquireOption
- type AcquireOptions
- type Condition
- type Event
- type Field
- type KubeLocker
- func (locker *KubeLocker) Acquire(l *Lock) error
- func (locker *KubeLocker) ConfigMapExists(l *Lock) (bool, error)
- func (locker *KubeLocker) CreateNewConfigMap(l *Lock) error
- func (locker *KubeLocker) GetAllLocks() ([]*Lock, error)
- func (locker *KubeLocker) GetConfigMap(l *Lock) (*corev1.ConfigMap, error)
- func (locker *KubeLocker) GetConfigMapName(l *Lock) string
- func (locker *KubeLocker) GetReservedConfigMap(l *Lock) (*corev1.ConfigMap, error)
- func (locker *KubeLocker) GetReservedConfigMapAttempt(l *Lock) (*corev1.ConfigMap, error)
- func (locker *KubeLocker) Init(l *Lock) error
- func (locker *KubeLocker) Release(l *Lock) error
- func (locker *KubeLocker) ReleaseConfigMap(l *Lock) error
- func (locker *KubeLocker) Renew(l *Lock) error
- func (locker *KubeLocker) UpdateAndReleaseConfigMap(ctx context.Context, cmap *corev1.ConfigMap) error
- type Lock
- func (l *Lock) Acquire(opts ...AcquireOption) error
- func (l *Lock) AcquireRetry(retries int, delay time.Duration) error
- func (l *Lock) Emit(e Event) error
- func (l *Lock) EmitAcquireFailed(err error)
- func (l *Lock) EmitAcquireSuccessful()
- func (l *Lock) EmitDebug(msg string)
- func (l *Lock) EmitMaintainStarted()
- func (l *Lock) EmitMaintainStopped()
- func (l *Lock) EmitReleaseFailed(err error)
- func (l *Lock) EmitReleaseSuccessful()
- func (l *Lock) EmitRenewFailed(err error)
- func (l *Lock) EmitRenewSuccessful()
- func (l *Lock) Evaluate(c *Condition) (bool, error)
- func (l *Lock) EvaluateSubconditions(c *Condition) (bool, error)
- func (l *Lock) Init()
- func (l *Lock) Maintain()
- func (l *Lock) NewExpiryTime() time.Time
- func (l *Lock) Release() error
- func (l *Lock) Renew() error
- func (l *Lock) WithContext(ctx context.Context) *Lock
- func (l *Lock) WithDuration(duration time.Duration) *Lock
- func (l *Lock) WithForce(c Condition) *Lock
- func (l *Lock) WithRenewInterval(interval time.Duration) *Lock
- func (l *Lock) WithResetTags() *Lock
- func (l *Lock) WithTags(tags []string) *Lock
- type LockLease
- type LockType
- type LockerInterface
- type Operation
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultEventHandler ¶
func GetKubeConfig ¶
Types ¶
type AcquireOption ¶ added in v0.5.3
type AcquireOption func(opts *AcquireOptions) error
func AcquireOptionWithRetry ¶ added in v0.5.3
func AcquireOptionWithRetry(rl *retry.RetryLogic) AcquireOption
type AcquireOptions ¶ added in v0.5.3
type AcquireOptions struct {
RetryLogic *retry.RetryLogic
}
type KubeLocker ¶
type KubeLocker struct { Clientset *kubernetes.Clientset Namespace string Prefix string }
func NewKubeLocker ¶
func NewKubeLocker(cset *kubernetes.Clientset, namespace string) *KubeLocker
func (*KubeLocker) Acquire ¶
func (locker *KubeLocker) Acquire(l *Lock) error
func (*KubeLocker) ConfigMapExists ¶
func (locker *KubeLocker) ConfigMapExists(l *Lock) (bool, error)
func (*KubeLocker) CreateNewConfigMap ¶
func (locker *KubeLocker) CreateNewConfigMap(l *Lock) error
func (*KubeLocker) GetAllLocks ¶
func (locker *KubeLocker) GetAllLocks() ([]*Lock, error)
func (*KubeLocker) GetConfigMap ¶
func (locker *KubeLocker) GetConfigMap(l *Lock) (*corev1.ConfigMap, error)
func (*KubeLocker) GetConfigMapName ¶
func (locker *KubeLocker) GetConfigMapName(l *Lock) string
func (*KubeLocker) GetReservedConfigMap ¶
func (locker *KubeLocker) GetReservedConfigMap(l *Lock) (*corev1.ConfigMap, error)
func (*KubeLocker) GetReservedConfigMapAttempt ¶ added in v0.5.0
func (locker *KubeLocker) GetReservedConfigMapAttempt(l *Lock) (*corev1.ConfigMap, error)
func (*KubeLocker) Init ¶
func (locker *KubeLocker) Init(l *Lock) error
func (*KubeLocker) Release ¶
func (locker *KubeLocker) Release(l *Lock) error
func (*KubeLocker) ReleaseConfigMap ¶
func (locker *KubeLocker) ReleaseConfigMap(l *Lock) error
TODO: look at potential corner-cases
func (*KubeLocker) Renew ¶
func (locker *KubeLocker) Renew(l *Lock) error
func (*KubeLocker) UpdateAndReleaseConfigMap ¶
type Lock ¶
type Lock struct { Name string `json:"name"` LockType LockType `json:"lockType"` Leases map[string]LockLease `json:"leases"` InstanceID string `json:"-"` Context context.Context `json:"-"` Cancel func() `json:"-"` Locker LockerInterface `json:"-"` Options // contains filtered or unexported fields }
func NewLock ¶
func NewLock(name string, locker LockerInterface) *Lock
func (*Lock) Acquire ¶
func (l *Lock) Acquire(opts ...AcquireOption) error
func (*Lock) EmitAcquireFailed ¶
func (*Lock) EmitAcquireSuccessful ¶
func (l *Lock) EmitAcquireSuccessful()
func (*Lock) EmitMaintainStarted ¶
func (l *Lock) EmitMaintainStarted()
func (*Lock) EmitMaintainStopped ¶
func (l *Lock) EmitMaintainStopped()
func (*Lock) EmitReleaseFailed ¶
func (*Lock) EmitReleaseSuccessful ¶
func (l *Lock) EmitReleaseSuccessful()
func (*Lock) EmitRenewFailed ¶
func (*Lock) EmitRenewSuccessful ¶
func (l *Lock) EmitRenewSuccessful()
func (*Lock) EvaluateSubconditions ¶
func (*Lock) NewExpiryTime ¶
func (*Lock) WithResetTags ¶
type LockerInterface ¶
Click to show internal directories.
Click to hide internal directories.