Documentation
¶
Index ¶
- Constants
- func NewLineReader() *lineReader
- type Dir
- type Error
- type ErrorType
- type File
- func (f *File) CheckMoved() (bool, error)
- func (f *File) CheckTruncated() (bool, Error)
- func (f *File) Close() error
- func (f *File) Fd() uintptr
- func (f *File) Name() string
- func (f *File) Read(b []byte) (int, error)
- func (f *File) SameFile(other *File) bool
- func (f *File) Seek(offset int64, whence int) (int64, Error)
- type FileTailer
- type Line
Constants ¶
View Source
const ( NotSpecified = iota DirectoryNotFound FileNotFound // The WinFileRemoved Error should never be seen, because it is handled internally in the FileTailer. // TODO: Refactor error handling such that this is not part of the public interface. WinFileRemoved )
Variables ¶
This section is empty.
Functions ¶
func NewLineReader ¶
func NewLineReader() *lineReader
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
File implementation that closes the file after each operation, in order to avoid "the file is in use by another process" errors on Windows. Note: Even if we use the FILE_SHARE_DELETE flag while opening the file, it is not save to keep it open. If another program deletes the file (like logrotate), the file will remain in the directory until grok_exporter closes it. In order to avoid this, we must not keep the file open.
func (*File) CheckMoved ¶
func (*File) CheckTruncated ¶
type FileTailer ¶
func RunFileTailer ¶
func RunFileTailer(globs []glob.Glob, readall bool, failOnMissingFile bool, log logrus.FieldLogger) (FileTailer, error)
func RunPollingFileTailer ¶
func RunPollingFileTailer(globs []glob.Glob, readall bool, failOnMissingFile bool, pollInterval time.Duration, log logrus.FieldLogger) (FileTailer, error)
Click to show internal directories.
Click to hide internal directories.