Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrWatcherNotInitialized = errors.New("the watcher is not initialized")
)
Functions ¶
This section is empty.
Types ¶
type S3Watcher ¶
type S3Watcher struct {
// contains filtered or unexported fields
}
func (*S3Watcher) Add ¶
Add a path to the watcher which consists of a bucket and prefix (what the path must start with). The prefix should not start with a forward slash (/). The prefix does not have to exist in the bucket. Returns an error if the watcher is not initialized.
func (*S3Watcher) ErrorChannel ¶
Returns the watcher's error channel. Only returns an error if the watcher is not initialized
func (*S3Watcher) EventChannel ¶
Returns the watcher's event channel. Only returns an error if the watcher is not initialized
func (*S3Watcher) New ¶
func (sw *S3Watcher) New(options WatcherOptions) error
Initialize the watcher
type S3WatcherOptions ¶
type Watcher ¶
type Watcher interface { // Set up a new instance of the Watcher New(WatcherOptions) error // Add a path (base path and object / file path) to watch, returns a nil error on success Add(string, string) error // Returns whether the watcher has been successfully initialized Initialized() bool // Return a slice of the paths that the watcher is monitoring Paths() []string // Return the event channel that sends a notification when an event has occurred // Returns an error if the Watcher has not been initialized EventChannel() (chan string, error) // Return the error channel that sends a notification when an error has occurred // Returns an error if the Watcher has not been initialized ErrorChannel() (chan error, error) // Performs any functions necessary to cleanly shutdown the watcher Close() }
type WatcherOptions ¶
type WatcherOptions interface{}
An empty interface for holding watcher options. These can be anything - it depends on the watcher.
Click to show internal directories.
Click to hide internal directories.