nwfs

package
v0.8.45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.8.42

type Config struct {
	Dir                string
	IgnoreDirs         []string
	SkipReadingContent bool
}

type Fs

type Fs struct {
	Config
	// contains filtered or unexported fields
}

func NewFs

func NewFs(config Config, logger ecslogger.ILogger) Fs

NewFs creates a new Fs instance.

func (Fs) Delete

func (f Fs) Delete(file NewFile) error

Delete deletes a file from the directory

func (Fs) Unprocessable

func (f Fs) Unprocessable(file NewFile) error

Unprocessable moves a file to unprocessable directory

func (Fs) Watch

func (f Fs) Watch(ctx context.Context, chanFiles chan NewFile) error

Watch watches the directory for top and nested new files and sends them to the channel, it also processes existing files. Files are uploaded after 100ms without a WRITE or CREATE event.

type IFs added in v0.8.18

type IFs interface {
	Watch(ctx context.Context, chanFiles chan NewFile) error
	Delete(file NewFile) error
	Unprocessable(file NewFile) error
}

type NewFile

type NewFile struct {
	Name         string
	Path         string
	RelativePath string
	Bytes        []byte
	ReceivedTime time.Time
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL