nwfs

package
v0.8.31 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 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 Fs

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

func NewFs

func NewFs(dir string, logger ecslogger.ILogger) Fs

NewFs creates a new Fs instance.

func (Fs) Delete

func (f Fs) Delete(file string) error

Delete deletes a file from the directory

func (Fs) Unprocessable

func (f Fs) Unprocessable(file string) 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 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 string) error
	Unprocessable(file string) error
}

type NewFile

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

Jump to

Keyboard shortcuts

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