file

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WatchFile

func WatchFile(eventConsumer FileEventEmitter, done util.Done, filePaths ...string) (err error)

Types

type Event

type Event = fsnotify.Event

type FileEvent

type FileEvent struct {
	OnCreate func(Event)
	OnWrite  func(Event)
	OnRemove func(Event)
	OnRename func(Event)
	OnChmod  func(Event)
}

func (*FileEvent) On

func (fe *FileEvent) On(ev Event)

type FileEventEmitter

type FileEventEmitter interface {
	On(Event)
}

type FileOp

type FileOp = fsnotify.Op
const (
	Create FileOp = 1 << iota
	Write
	Remove
	Rename
	Chmod
)

type FileStat

type FileStat struct {
	Name    string
	Mode    fs.FileMode
	Size    memory.MemorySize
	IsDir   bool
	ModTime time.Time
}

Jump to

Keyboard shortcuts

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