Documentation ¶
Index ¶
Constants ¶
View Source
const (
//NSEnvVar is containing the value of the namespace leases will be managed at, in case it's empty defaultLeaseNs will be used
NSEnvVar = "LEASE_NAMESPACE"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlreadyHeldError ¶ added in v1.2.0
type AlreadyHeldError struct {
// contains filtered or unexported fields
}
AlreadyHeldError is returned in case the lease is already held by a different holder
func (AlreadyHeldError) Error ¶ added in v1.2.0
func (e AlreadyHeldError) Error() string
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) }
Click to show internal directories.
Click to hide internal directories.