Documentation ¶
Index ¶
- func Glob(pattern string, doubleStarPatternDepth uint8) ([]string, error)
- func GlobPatterns(pattern string, doubleStarPatternDepth uint8) ([]string, error)
- func IsSameFile(path string, info os.FileInfo) bool
- func ReadOpen(path string) (*os.File, error)
- func SafeFileRotate(path, tempfile string) error
- type File
- type State
- type StateOS
- type States
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Glob ¶
Glob expands '**' patterns into multiple patterns to satisfy https://golang.org/pkg/path/filepath/#Match
func GlobPatterns ¶
GlobPatterns detects the use of "**" and expands it to standard glob patterns up to a max depth
func IsSameFile ¶
IsSameFile checks if the given File path corresponds with the FileInfo given
func SafeFileRotate ¶
SafeFileRotate safely rotates an existing file under path and replaces it with the tempfile
Types ¶
type File ¶
func (*File) IsSameFile ¶
Checks if the two files are the same.
type State ¶
type State struct { Id string `json:"-"` // local unique id to make comparison more efficient Finished bool `json:"-"` // harvester state Fileinfo os.FileInfo `json:"-"` // the file info Source string `json:"source"` Offset int64 `json:"offset"` Timestamp time.Time `json:"timestamp"` TTL time.Duration `json:"ttl"` Type string `json:"type"` FileStateOS StateOS }
State is used to communicate the reading state of a file
type StateOS ¶
func GetOSState ¶
GetOSState returns the FileStateOS for non windows systems
type States ¶
States handles list of FileState
func (*States) Cleanup ¶
Cleanup cleans up the state array. All states which are older then `older` are removed The number of states that were cleaned up is returned