Documentation
¶
Index ¶
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
Types ¶
type File ¶
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
func NewState ¶
NewState creates a new file state
type StateOS ¶
func GetOSState ¶
GetOSState returns the FileStateOS for non windows systems
func (StateOS) IsSame ¶
IsSame file checks if the files are identical
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
func (*States) SetStates ¶
SetStates overwrites all internal states with the given states array
Source Files
¶
- file.go
- file_other.go
- glob.go
- state.go