Documentation
¶
Index ¶
Constants ¶
View Source
const (
KeyExcelFolder = "path"
)
Variables ¶
View Source
var ErrorOpenFileFailed = errors.New("failed to open file")
View Source
var FileWatcheSettingKey = "files"
Functions ¶
func FileExisted ¶
func NewWatchExcelFolder ¶
func NewWatchExcelFolder(p FileWatcherParams) ginshared.DiController
Types ¶
type FileAction ¶
type FileIdempotent ¶
type FileIdempotentParams ¶
type FileWatcherParams ¶
type FileWatcherParams struct { dig.In Ctx context.Context Logger *zap.Logger Action FileAction Idempotent *FileIdempotent `optional:"true"` }
type FilelWatcher ¶
type FilelWatcher struct { Logger *zap.Logger Action FileAction Recursive bool Path string Interval time.Duration Included []string Excluded []string RetryDelay time.Duration RetryAttempts uint Delete bool DoneFolder string ErrorFolder string }
FileWatcher, not support recursion & idempotent yet.
func (*FilelWatcher) Filter ¶
func (e *FilelWatcher) Filter(file string) bool
func (*FilelWatcher) ScheduleWalk ¶
func (e *FilelWatcher) ScheduleWalk(ctx context.Context)
func (*FilelWatcher) StartService ¶
func (e *FilelWatcher) StartService(ctx context.Context)
func (*FilelWatcher) StartWatcher ¶
func (e *FilelWatcher) StartWatcher(ctx context.Context) error
func (*FilelWatcher) Walk ¶
func (e *FilelWatcher) Walk()
Click to show internal directories.
Click to hide internal directories.