csnotify

package module
v0.1.1-0...-a352261 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

README

Cloud storage notifications for Go

Watch objects in S3 buckets and get notifiations when they have changed.

Inspired by fsnotify

Notes

  • Specify path in S3: s3://<bucketName>/path/to/object.
  • Only supports objects.

Examples

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Path string // path to object.
}

Event represents an object notification.

type Watcher

type Watcher struct {
	Events chan Event
	Errors chan error
	// contains filtered or unexported fields
}

Watcher watches a set of objects, delivering events to a channel.

func NewWatcher

func NewWatcher() (*Watcher, error)

NewWatcher creates a new session and begins waiting for events.

func (*Watcher) Add

func (w *Watcher) Add(path string)

Add starts watching the specified S3 object path (non-recursively).

func (*Watcher) Remove

func (w *Watcher) Remove(path string)

Remove stops watching the specified S3 object path (non-recursively).

Jump to

Keyboard shortcuts

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