bigbrother

package module
v0.0.0-...-f7349af Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

README

bigbrother

Big Brother is watching files (file watching system)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlreadyWatcherStarted = errors.New("Watcher already started")
View Source
var FolderOrFileNameCannotBeEmpty = errors.New("Folder or file name can not be empty")
View Source
var FolderOrFileNotFound = errors.New("Folder or file not found!")
View Source
var InvalidWatcher = errors.New("Please Provide watcher")

Functions

func FilePathWalkDir

func FilePathWalkDir(root string) ([]string, error)

Types

type Command

type Command interface {
	ID() string // unique identifier for this command
	Command(info FileInfo)
}

type FileInfo

type FileInfo struct {
	ID   string //fixme:uuid maybe ??
	Name string

	Dir bool

	Files []*FileInfo

	CreateAt time.Time
	Version  int

	IsRoot bool
}

func (*FileInfo) ChangeName

func (f *FileInfo) ChangeName(name string) error

func (*FileInfo) Get

func (f *FileInfo) Get(name string) (*FileInfo, error)

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

type FileStatusRepository

type FileStatusRepository interface {
}

type OP

type OP int
const (
	Created OP = iota
	Removed
	Renamed
	Modified
)

func (OP) Same

func (p OP) Same(SecondOP OP) bool

func (OP) String

func (p OP) String() string

type Watcher

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

func (*Watcher) AddCommand

func (w *Watcher) AddCommand(cmd Command) string

func (*Watcher) AddPath

func (w *Watcher) AddPath(path string) error

AddPath Adds directories to watcher doesn't care files

func (*Watcher) Close

func (w *Watcher) Close()

func (*Watcher) Start

func (w *Watcher) Start() error

Jump to

Keyboard shortcuts

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