ttl

package
v0.0.0-...-1c5d739 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunSnapshotTTL

func RunSnapshotTTL(client SnapshotTTLInterface, cancel <-chan interface{}, min, max time.Duration)

RunSnapshotTTL runs the ttl for snapshots

Types

type SnapshotTTL

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

SnapshotTTL is the TTL for snapshots

func (*SnapshotTTL) Name

func (ttl *SnapshotTTL) Name() string

Name identifies the TTL instance

func (*SnapshotTTL) Purge

func (ttl *SnapshotTTL) Purge(age time.Duration) (time.Duration, error)

Purge deletes snapshots as they reach a particular age. Returns the time to wait til the next snapshot is to be deleted. Implements utils.TTL

type SnapshotTTLInterface

type SnapshotTTLInterface interface {
	// GetTenantIDs returns all tenant IDs
	GetTenantIDs(struct{}, *[]string) error
	// ListSnapshots returns the list of all snapshots given a service id
	ListSnapshots(string, *[]dao.SnapshotInfo) error
	// DeleteSnapshot deletes a snapshot by SnapshotID
	DeleteSnapshot(string, *int) error
}

SnapshotTTLInterface is the client handler for SnapshotTTL

Jump to

Keyboard shortcuts

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