lease

package
v0.0.0-...-501dce0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLeaseTTL = time.Duration(15) * time.Second // 60 seconds

DefaultLeaseTTL is the length LeaseRequests can stay alive before they need to be replaced

View Source
const LeaseAvailableAckTTL = time.Duration(5) * time.Second // 5 seconds

LeaseAvailableAckTTL defines how long to wait for a client to ack a LeaseAvailable notification

Variables

This section is empty.

Functions

func LeaseFilterAll

func LeaseFilterAll(l Lease) bool

LeaseFilterAll returns all Leases

func LeaseRequestFilterAll

func LeaseRequestFilterAll(l LeaseRequest) bool

LeaseRequestFilterAll returns all LeaseRequests

Types

type Lease

type Lease struct {
	LeaseID  string
	ClientID string
	VolumeID string
	Expires  time.Time
	Status   LeaseStatus
}

Lease represents a lease of a volume to a client, for a given period of time

type LeaseFilterFunc

type LeaseFilterFunc func(Lease) bool

LeaseFilterFunc is a function to filter a list of Leases based on a given condition

func LeaseFilterByClient

func LeaseFilterByClient(id string) LeaseFilterFunc

LeaseFilterByClient returns all Leases for a given client

type LeaseRequest

type LeaseRequest struct {
	LeaseRequestID         string
	ClientID               string
	VolumeTag              string
	VolumeAvailabilityZone string
	Expires                time.Time
}

LeaseRequest represets a client's desire to lease a given volume

type LeaseRequestFilterFunc

type LeaseRequestFilterFunc func(LeaseRequest) bool

LeaseRequestFilterFunc is a function to filter a list of LeaseRequests based on a given condition

func LeaseRequestFilterByClient

func LeaseRequestFilterByClient(id string) LeaseRequestFilterFunc

LeaseRequestFilterByClient returns all LeaseRequests for a given client

type LeaseStatus

type LeaseStatus int
const (
	LeaseStatusUnknown LeaseStatus = iota

	LeaseStatusAssigning

	LeaseStatusAssigned

	LeaseStatusReleasing
)

Jump to

Keyboard shortcuts

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