fileobject

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

fileobject implements rotation for filesystem objects using os.Stat and os.Remove.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File captures a file path and it's mtime, providing methods for the Object interface. The mtime is cached to avoid hammering the filesystem during sorting.

func (File) Age

func (f File) Age() time.Duration

Age returns the age of the object as a time.Duration.

func (File) Delete

func (f File) Delete() error

Delete attempts to remove the file object. No error is returned if it already doesn't exist.

func (File) ID

func (f File) ID() string

ID returns the path for the file object.

type Files

type Files string

Files wraps a string (assumed to be a path glob) to provide Objects operations on it.

func (Files) ID

func (f Files) ID() string

ID returns the path glob for the object.

func (Files) List

func (f Files) List() ([]agerotate.Object, error)

List returns the File items matching the glob.

Directories

Path Synopsis
config parses a config file for rotation of File objects.
config parses a config file for rotation of File objects.

Jump to

Keyboard shortcuts

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