lease

package
v0.0.0-...-c6d711a Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSecretaryFinder

func NewSecretaryFinder(controllerUUID string) lease.SecretaryFinder

NewCabinet returns a SecretaryFinder with default set of secretaries registered with it. Note: a cabinet is a group of secretaries.

Types

type LeadershipSecretary

type LeadershipSecretary struct {
	// contains filtered or unexported fields
}

LeadershipSecretary implements Secretary; it checks that leases are application names, and holders are unit names.

func (LeadershipSecretary) CheckDuration

func (LeadershipSecretary) CheckDuration(duration time.Duration) error

CheckDuration is part of the lease.Secretary interface.

func (LeadershipSecretary) CheckHolder

func (LeadershipSecretary) CheckHolder(name string) error

CheckHolder is part of the lease.Secretary interface.

func (LeadershipSecretary) CheckLease

func (LeadershipSecretary) CheckLease(key lease.Key) error

CheckLease is part of the lease.Secretary interface.

type ObjectStoreSecretary

type ObjectStoreSecretary struct {
	// contains filtered or unexported fields
}

ObjectStoreSecretary implements Secretary; it checks that leases are application names, and holders are unit names.

func (ObjectStoreSecretary) CheckDuration

func (ObjectStoreSecretary) CheckDuration(duration time.Duration) error

CheckDuration is part of the lease.Secretary interface.

func (ObjectStoreSecretary) CheckHolder

func (ObjectStoreSecretary) CheckHolder(name string) error

CheckHolder is part of the lease.Secretary interface.

func (ObjectStoreSecretary) CheckLease

func (ObjectStoreSecretary) CheckLease(key lease.Key) error

CheckLease is part of the lease.Secretary interface.

type SecretaryFinder

type SecretaryFinder struct {
	// contains filtered or unexported fields
}

SecretaryFinder is responsible for returning the correct Secretary for a given namespace.

func (SecretaryFinder) Register

func (c SecretaryFinder) Register(namespace string, secretary lease.Secretary)

Register adds a Secretary to the Cabinet.

func (SecretaryFinder) SecretaryFor

func (c SecretaryFinder) SecretaryFor(namespace string) (lease.Secretary, error)

SecretaryFor returns the Secretary for the given namespace. Returns an error if the namespace is not valid.

type SingularSecretary

type SingularSecretary struct {
	ControllerUUID string
	// contains filtered or unexported fields
}

SingularSecretary implements Secretary to restrict claims to either a lease for the controller or the specific model it's asking for, holdable only by machine-tag strings.

func (SingularSecretary) CheckDuration

func (SingularSecretary) CheckDuration(duration time.Duration) error

CheckDuration is part of the lease.Secretary interface.

func (SingularSecretary) CheckHolder

func (s SingularSecretary) CheckHolder(name string) error

CheckHolder is part of the lease.Secretary interface.

func (SingularSecretary) CheckLease

func (s SingularSecretary) CheckLease(key lease.Key) error

CheckLease is part of the lease.Secretary interface.

Jump to

Keyboard shortcuts

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