fileutil

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package fileutil provide functionality for working with files and directories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MoveFile

func MoveFile(ctx context.Context, name, sourceDir, destDir string) error

MoveFile moves file from base dir to target.

func PollDirectory

func PollDirectory(ctx context.Context, dir string, availableExtensions map[string]bool, respChan chan<- PollResponse)

PollDirectory will pol for files that needs to be processed.

func WriteFile

func WriteFile(fname, dir, data string) error

WriteFile creates file with passed name at passed dir and writes data.

Types

type PollResponse added in v0.10.0

type PollResponse struct {
	File string
	Err  error
}

PollResponse represents response of directory poll. Filename of new file if it appears, and error if smth went wrong.

Jump to

Keyboard shortcuts

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