Add lease expiration to garbage collection
Allow setting an expiration label to have the garbage collector remove an item after the specified time. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
17
leases/lease.go
Normal file
17
leases/lease.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package leases
|
||||
|
||||
import "time"
|
||||
|
||||
type LeaseOpt func(*Lease)
|
||||
|
||||
type LeaseManager interface {
|
||||
Create(...LeaseOpt) (Lease, error)
|
||||
Delete(Lease) error
|
||||
List(...string) ([]Lease, error)
|
||||
}
|
||||
|
||||
type Lease struct {
|
||||
ID string
|
||||
CreatedAt time.Time
|
||||
Labels map[string]string
|
||||
}
|
||||
Reference in New Issue
Block a user