Documentation
¶
Overview ¶
Package snd is an afero sync & delete file system
Index ¶
- Variables
- type Behavior
- type Config
- type File
- type Fs
- func (fs *Fs) Chmod(name string, mode os.FileMode) error
- func (fs *Fs) Chown(name string, uid, gid int) error
- func (fs *Fs) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (fs *Fs) Close() error
- func (fs *Fs) MkDir(name string, perm os.FileMode) error
- func (fs *Fs) MkdirAll(path string, perm os.FileMode) error
- func (fs *Fs) Name() string
- func (fs *Fs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)
- func (fs *Fs) Remove(name string) error
- func (fs *Fs) RemoveAll(path string) error
- func (fs *Fs) Rename(oldName, newName string) error
- func (fs *Fs) Sync() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoDestination = errors.New("destination FS needs to be specified")
ErrNoDestination is returned when the destination is nil
Functions ¶
This section is empty.
Types ¶
type Behavior ¶
type Behavior struct {
FileNbMin *int // Minimum number of files to keep
FileAgeMin time.Duration // Minimum age of a file to be deleted
OperationsQueueSize int // Queue of operations to perform
CleanupPeriod time.Duration // Period of time between cleanups
}
Behavior defines the GC logic
type Config ¶
type Config struct {
Destination afero.Fs
Temporary afero.Fs
Behavior *Behavior
Logger *slog.Logger
}
Config defines the SND file system configuration
type File ¶
type File struct {
afero.File // Underlying temporary file
// contains filtered or unexported fields
}
File is the internal representation of a file
type Fs ¶
Fs is the SND file system
Click to show internal directories.
Click to hide internal directories.