Documentation ¶
Overview ¶
agerotate provides cleanup of timestamped objects with user-defined schedules. Objects are grouped into "buckets" based on their age. Each bucket has an age threshold and an age interval. If a bucket has an interval of two hours, roughly one object will be kept for every two hours. This allows the user to keep many objects that are recent and fewer objects that are older.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByAge ¶
type ByAge []Range
ByAge implements sort.Interface to sort Range objects by Age, ascending.
type Object ¶
type Object interface { // Age returns the age of the object. Age() time.Duration // Delete attempts to remove the object. Delete() error // ID returns an identifier string that is intended to be unique. ID() string }
Object is the interface objects implement to be managed by agerotate.
type Objects ¶
type Objects interface { // ID returns an identifier string that is intended to be unique. ID() string // List retrieves all of the available Objects. List() ([]Object, error) }
Objects is the interface for a container of Object objects.
type ObjectsByAge ¶
type ObjectsByAge struct {
O []Object
}
ObjectsByAge implements sort.Interface to sort Objects by Age, ascending.
func (ObjectsByAge) Len ¶
func (a ObjectsByAge) Len() int
func (ObjectsByAge) Less ¶
func (a ObjectsByAge) Less(i, j int) bool
func (ObjectsByAge) Swap ¶
func (a ObjectsByAge) Swap(i, j int)
Directories ¶
Path | Synopsis |
---|---|
bucket captures objects below a certain age, decides which ones should be deleted, and deletes them.
|
bucket captures objects below a certain age, decides which ones should be deleted, and deletes them. |
fileobject implements rotation for filesystem objects using os.Stat and os.Remove.
|
fileobject implements rotation for filesystem objects using os.Stat and os.Remove. |
config
config parses a config file for rotation of File objects.
|
config parses a config file for rotation of File objects. |