Documentation ¶
Overview ¶
Package playlist list files from a folder resuming the last file listed.
Index ¶
- Constants
- Variables
- func GetNextFiles(fileList []string, count int, fromFilePath string) []string
- func ListFilesByDateCreation(path string, filterExtensions []string) ([]string, error)
- func ListFilesByFileNamePath(path string, filterExtensions []string) ([]string, error)
- type FileSortMode
- type Playlist
Constants ¶
const ( // FileSortModeFileNameAsc represents the file sort mode by file name ascendant. FileSortModeFileNameAsc = iota // FileSortModeTimestampCreationAsc represents the file sort mode by file timestamp creation ascendant. FileSortModeTimestampCreationAsc )
Variables ¶
var ( // ErrUnsupportedFileSortMode represent the error when a file sort mode given is unknown. ErrUnsupportedFileSortMode = fmt.Errorf("unsupported file sort mode") )
Functions ¶
func GetNextFiles ¶
GetNextFiles return the count given file path names from the file list given after the from the file path given.
func ListFilesByDateCreation ¶
ListFilesByDateCreation lists file path sorted by timestamp creation ascendant on the given path and filter them with extension given.
Types ¶
type FileSortMode ¶
type FileSortMode uint
A FileSortMode represents a the mechanisms to sort files result.
type Playlist ¶
type Playlist struct { }
Playlist contains the mechanism to list file names.
func (*Playlist) GetNextFilesFromPath ¶
func (*Playlist) GetNextFilesFromPath( path string, count int, fileExtension []string, sortMode FileSortMode) ([]string, error)
GetNextFilesFromPath returns existing files names on the path given following the next steps: 1. List file names by the sort mode given and filter them by the extension given. 2. Load from the ini configuration file which was the last file name processed. If there is no file, it will return empty string. 3. Get next N count value given file from the last file name processed. 4. Save the last file name returned on the filter list. 5. Return the full list to processed.