filesystem

package
v0.0.0-...-447d7c9 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2017 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filesystem

type Filesystem interface {
	Fetch(name string) (file io.ReadCloser, err error)
	Upload(contents io.Reader) (fid string, written int, err error)
	Delete(name string) error
	// consider streaming
	Close() error
}

Filesystem is an interface for anything that allows storing files remotely

type Flat

type Flat struct {
	// contains filtered or unexported fields
}

Flat is a local flatfile implementation of Filesystem

func NewFlat

func NewFlat(cfg config.FlatConfig) (*Flat, error)

NewFlat returns a new flat filesystem

func (*Flat) Close

func (f *Flat) Close() error

Close is a nop for flatfs nop until streaming is implemented

func (*Flat) Delete

func (f *Flat) Delete(name string) error

Delete removes the file by name

func (*Flat) Fetch

func (f *Flat) Fetch(name string) (io.ReadCloser, error)

Fetch loads up a file by name

func (*Flat) Upload

func (f *Flat) Upload(contents io.Reader) (string, int, error)

Upload generates a new name for a file and saves it

type Seaweed

type Seaweed struct {
	Client *weedo.Client
}

Seaweed is an implementation of SeaweedFS connection

func NewSeaweed

func NewSeaweed(cfg config.SeaweedConfig) (*Seaweed, error)

NewSeaweed creates a new SeaweedFS client

func (*Seaweed) Close

func (s *Seaweed) Close() error

Close is a nop for seaweedfs

func (*Seaweed) Delete

func (s *Seaweed) Delete(name string) error

Delete removes a file from the server

func (*Seaweed) Fetch

func (s *Seaweed) Fetch(name string) (io.ReadCloser, error)

Fetch downloads a file from the storage

func (*Seaweed) Upload

func (s *Seaweed) Upload(contents io.Reader) (string, int, error)

Upload sends a file to the storage

Jump to

Keyboard shortcuts

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