Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { State State ID uint64 // uuid Tasks sync.Map // map[taskid]*keyword.TaskConfig IsDeleted bool // 标志位,记录文件是否已被删除,用来清理任务 IsInactivated bool // 标志位,记录文件是否由于长期未写入数据,进入未激活状态,用来清理任务 }
func (*File) AddTask ¶
func (f *File) AddTask(t *keyword.TaskConfig)
func (*File) IsSameFile ¶
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 INode uint64 `json:"-"` // the file inode Source string `json:"source"` Offset int64 `json:"offset"` Timestamp time.Time `json:"timestamp"` TTL time.Duration `json:"ttl"` Inactive int64 `json:"inactive"` // record time, how long time has no write(unit: minutes) Type string `json:"type"` }
State is used to communicate the reading state of a file
Click to show internal directories.
Click to hide internal directories.