Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRegularFile ¶
func IsSameFile ¶
IsSameFile checks if the given File path corresponds with the FileInfo given
func ReadOpen ¶
ReadOpen opens a file for reading only As Windows blocks deleting a file when its open, some special params are passed here.
func SafeFileRotate ¶
SafeFileRotate safely rotates an existing file under path and replaces it with the tempfile
Types ¶
type File ¶
func (*File) IsRegularFile ¶
Check that the file isn't a symlink, mode is regular or file is nil
func (*File) IsSameFile ¶
Checks if the two files are the same.
type FileEvent ¶
type FileEvent struct { ReadTime time.Time Source *string InputType string DocumentType string Offset int64 Bytes int Text *string Fields *common.MapStr Fileinfo *os.FileInfo // contains filtered or unexported fields }
FileEvent is sent to the output and must contain all relevant information
func (*FileEvent) GetState ¶
GetState builds and returns the FileState object based on the Event info.
func (*FileEvent) SetFieldsUnderRoot ¶
SetFieldsUnderRoot sets whether the fields should be added top level to the output documentation (fieldsUnderRoot = true) or under a fields dictionary.
type FileState ¶
type FileState struct { Source *string `json:"source,omitempty"` Offset int64 `json:"offset,omitempty"` FileStateOS *FileStateOS }
type FileStateOS ¶
type FileStateOS struct { IdxHi uint64 `json:"idxhi,omitempty"` IdxLo uint64 `json:"idxlo,omitempty"` Vol uint64 `json:"vol,omitempty"` }
func GetOSFileState ¶
func GetOSFileState(info *os.FileInfo) *FileStateOS
GetOSFileState returns the platform specific FileStateOS
func (*FileStateOS) IsSame ¶
func (fs *FileStateOS) IsSame(state *FileStateOS) bool
IsSame file checks if the files are identical