fs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImageExtensionRegex = regexp.MustCompile(".*.jpg$|.*.jpeg$|.*.png$|.*.webp$|.*.JPG$|.*.JPEG$|.*.PNG$|.*.WEBP$")

ImageExtensionRegex are all the supported image extensions, and the only ones that will be included in file search/globbing.

Functions

func AlreadyUpsized

func AlreadyUpsized(originalImage path.Entry, outputPath string) bool

AlreadyUpsized checks if we already upsized the image.

func MakeDir

func MakeDir(path string) error

MakeDir will create a directory if it does not already exist.

func WatchDir

func WatchDir(ctx context.Context, inputDir, outputDir string, images chan path.Entry) error

WatchDir will watch the given dir for new files and will publish the ones not already upsized to the given images chan.

func WatchEventChanToEntryChan

func WatchEventChanToEntryChan(watchEvents chan path.WatchEvent) chan path.Entry

WatchEventToEntry convert path.WatchEvent to path.Entry

func WatchEventToEntry

func WatchEventToEntry(watchEvents []path.WatchEvent) []path.Entry

WatchEventToEntry convert path.WatchEvent to path.Entry

Types

This section is empty.

Jump to

Keyboard shortcuts

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