storage

package
v0.0.0-...-de9e5da Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package storage provides primitives necessary for working with the underlying storage.

Index

Constants

This section is empty.

Variables

View Source
var ErrBadFilename = errors.New("bad filename")

ErrBadFilename is returned by the Saver in response to Upload() if filename is empty.

Functions

This section is empty.

Types

type Lister

type Lister interface {
	GetList() (messages.FilesInfo, error)
}

Lister returns the directory's listing. Only files are listed.

func NewLister

func NewLister(path string) (Lister, error)

NewLister returns the Lister that returns listings for the given path.

type Notifier

type Notifier interface {
	GetNotificationChan() <-chan messages.FileChangeNotification
	// Close shuts down the Notifier.
	Close() error
}

Notifier pipes the filesystem change notifications to the output channel. Use GetNotificationChan() to retrieve it.

func NewNotifier

func NewNotifier(path string) (Notifier, error)

NewNotifier returns the initiated Notifier that watches the specified directory.

type Saver

type Saver interface {
	Upload(name string, r io.Reader) error
}

Saver saves the Reader's contents to the file.

func NewSaver

func NewSaver(dirPath string) (Saver, error)

NewSaver returns a Saver that uploads files to the specified directory.

Jump to

Keyboard shortcuts

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