event

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	// File is the name of the file
	File string
	// Path is the path to the file
	Path string
	// Destination is the path to the destination
	Destination string
	// Ext is the file extension
	Ext string
	// Operation is the operation that was performed
	Operation string
	// IsDir is the new create vent a directory
	IsDir bool
	// Timestamp in unix time epoch
	Timestamp time.Time
}

Event is a struct that holds the information for a file event

func New

func New(file, path, dest, ext string) *Event

New creates and returns a new event struct

func (*Event) IsNewDirEvent

func (e *Event) IsNewDirEvent() bool

IsNewDirEvent returns a bool if the given path is a directory or not

func (*Event) IsValidEvent

func (e *Event) IsValidEvent(ext string) bool

IsValidEvent checks if the event operation and file extension is valid

func (*Event) Move

func (e *Event) Move(path, file string) error

Move moves the file to the destination

Jump to

Keyboard shortcuts

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