spectator

package
v0.0.0-...-ee4f6db Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2020 The Go Authors and UGO Authors

Package ugoSpectator implements a simple library to watch files on the directory specified.

Methods:

Init() (*UgoSpectator, error)
Close() error

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UgoSpectator

type UgoSpectator struct {
	Watcher *fsnotify.Watcher // *fsnotify watcher instance

	Ch        chan bool          // ch to trigger on file change
	CancelCtx context.CancelFunc // context to cancel
	// contains filtered or unexported fields
}

UgoSpectator struct with Watcher and all methods

func Init

func Init(dirname string) (*UgoSpectator, error)

Init initializes the fsnotify NewWatcher and

a *fsnotify watcher instance and an error

func (*UgoSpectator) Close

func (u *UgoSpectator) Close() error

Close return error if an error occurs during the closing of the fsnotify watcher instance

Jump to

Keyboard shortcuts

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