Documentation ¶
Index ¶
- func GetAbsPath(p string) string
- func IsDir(dir string) bool
- func IsExist(path string) bool
- func LookupFiles(dir string, pattern string) ([]string, error)
- type DirReader
- type Dispatcher
- type FileProcessingTime
- type FileReader
- type FilesHandler
- type GzipFileReader
- type PTailFileReader
- type ProcessStatus
- func (ps *ProcessStatus) Close()
- func (ps *ProcessStatus) GetProcessedFiles() map[string]FileProcessingTime
- func (ps *ProcessStatus) IsProcessed(file string) bool
- func (ps *ProcessStatus) OnFileDeleted(path string)
- func (ps *ProcessStatus) OnFileProcessingFinished(path string, startProcessing time.Time)
- type StringArray
- type TextFileReader
- type TextFileTailReader
- type TextModule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAbsPath ¶
GetAbsPath gets the absolute path of the giving path p
func IsDir ¶
IsDir returns true if given path is a directory, or returns false when it's a file or does not exist.
Types ¶
type DirReader ¶
type DirReader struct { Running bool // contains filtered or unexported fields }
func NewPathReader ¶
func (*DirReader) GetPendingFileCount ¶
func (*DirReader) OnFileCreated ¶
func (*DirReader) OnFileModified ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func New ¶
func New() (*Dispatcher, error)
func (*Dispatcher) Close ¶
func (d *Dispatcher) Close()
func (*Dispatcher) Register ¶
func (d *Dispatcher) Register(m TextModule)
func (*Dispatcher) Run ¶
func (d *Dispatcher) Run()
func (*Dispatcher) Stop ¶
func (d *Dispatcher) Stop()
type FileReader ¶
type FilesHandler ¶
type FilesHandler struct {
// contains filtered or unexported fields
}
func NewFilesHandler ¶
func NewFilesHandler(dir string) (h *FilesHandler, err error)
func (*FilesHandler) OnFileCreated ¶
func (h *FilesHandler) OnFileCreated(file string)
func (*FilesHandler) OnFileModified ¶
func (h *FilesHandler) OnFileModified(file string)
func (*FilesHandler) RecordPos ¶
func (h *FilesHandler) RecordPos() (err error)
func (*FilesHandler) Run ¶
func (h *FilesHandler) Run()
func (*FilesHandler) Stop ¶
func (h *FilesHandler) Stop()
type GzipFileReader ¶
type GzipFileReader struct {
// contains filtered or unexported fields
}
func NewGzipFileReader ¶
func NewGzipFileReader() *GzipFileReader
func (*GzipFileReader) LoadFile ¶
func (r *GzipFileReader) LoadFile(filepath string, fp *os.File) (err error)
func (*GzipFileReader) ReadLine ¶
func (r *GzipFileReader) ReadLine() (line []byte, err error)
type PTailFileReader ¶
type PTailFileReader struct {
// contains filtered or unexported fields
}
func NewPTailFileReader ¶
func NewPTailFileReader() *PTailFileReader
func (*PTailFileReader) LoadFile ¶
func (r *PTailFileReader) LoadFile(filepath string, fp *os.File) (err error)
func (*PTailFileReader) ReadLine ¶
func (r *PTailFileReader) ReadLine() (line []byte, err error)
type ProcessStatus ¶
type ProcessStatus struct {
// contains filtered or unexported fields
}
func NewProcessStatus ¶
func NewProcessStatus(statusFile string) (ps *ProcessStatus, err error)
func (*ProcessStatus) Close ¶
func (ps *ProcessStatus) Close()
func (*ProcessStatus) GetProcessedFiles ¶
func (ps *ProcessStatus) GetProcessedFiles() map[string]FileProcessingTime
func (*ProcessStatus) IsProcessed ¶
func (ps *ProcessStatus) IsProcessed(file string) bool
func (*ProcessStatus) OnFileDeleted ¶
func (ps *ProcessStatus) OnFileDeleted(path string)
func (*ProcessStatus) OnFileProcessingFinished ¶
func (ps *ProcessStatus) OnFileProcessingFinished(path string, startProcessing time.Time)
type StringArray ¶
type StringArray []string
func (StringArray) Len ¶
func (ss StringArray) Len() int
func (StringArray) Less ¶
func (ss StringArray) Less(i, j int) bool
func (StringArray) Swap ¶
func (ss StringArray) Swap(i, j int)
type TextFileReader ¶
type TextFileTailReader ¶
type TextFileTailReader struct {
// contains filtered or unexported fields
}
func NewTextFileTailReader ¶
func NewTextFileTailReader(dr *DirReader) *TextFileTailReader
type TextModule ¶
type TextModule interface {
OnRecord([]byte)
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.