lease

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	//RequestLease will create a lease with leaseDuration if it does not exist or extend existing lease duration to leaseDuration.
	//It'll return an error in case it can't do either (for example if the lease is already taken).
	RequestLease(ctx context.Context, obj client.Object, leaseDuration time.Duration) error
	//InvalidateLease will release the lease.
	InvalidateLease(ctx context.Context, obj client.Object) error
	//GetLease will try to fetch a lease.
	//It'll return an error in case it can't (for example if the lease does not exist or is already taken).
	GetLease(ctx context.Context, obj client.Object) (*coordv1.Lease, error)
}

func NewManager

func NewManager(cl client.Client, holderIdentity string, namespace string) Manager

func NewManagerWithCustomLogger

func NewManagerWithCustomLogger(cl client.Client, holderIdentity string, namespace string, log logr.Logger) Manager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL