watcher

package
v0.0.0-...-87c69e2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Show

func Show(cfg *Config, path string) (list []*ftp.Entry, err error)

Types

type Config

type Config struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type Directory

type Directory struct {
	Path string `json:"path,omitempty"`
	Hash uint32 `json:"hash,omitempty"`
}

type Watcher

type Watcher struct {
	Dirs map[string]uint32
	// contains filtered or unexported fields
}

func New

func New(cfg Config) (w Watcher, err error)

func (*Watcher) CheckChanged

func (w *Watcher) CheckChanged(dir string) (changed bool)

func (*Watcher) GetAllFiles

func (w *Watcher) GetAllFiles(path string) (files []string)

func (Watcher) GetHash

func (w Watcher) GetHash(dir string) (h uint32, err error)

func (Watcher) LoadFiles

func (w Watcher) LoadFiles(path string, files []string)

func (*Watcher) Stop

func (w *Watcher) Stop()

func (Watcher) Watch

func (w Watcher) Watch(ctx context.Context, dirs []string, updateTime time.Duration, notify chan string)

Jump to

Keyboard shortcuts

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