Documentation ¶
Index ¶
Constants ¶
View Source
const (
KeyExcelFolder = "path"
)
Variables ¶
View Source
var ErrorShouldRetry = errors.New("process failed but should retry")
View Source
var FileWatcheSettingKey = "files"
Functions ¶
func FileExisted ¶
func NewWatchExcelFolder ¶
func NewWatchExcelFolder(p FileWatcherParams) ginshared.DiController
Types ¶
type FileAction ¶
type FileIdempotent ¶
type FileIdempotentService ¶
func (*FileIdempotentService) Idempotent ¶
func (fs *FileIdempotentService) Idempotent(file string) (bool, error)
type FileWatcherParams ¶
type FileWatcherParams struct { dig.In Ctx context.Context Logger *zap.Logger Action FileAction Idempotent *FileIdempotentService `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 ShouldRetry retry.RetryIfFunc Idempotent *FileIdempotentService }
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.