storage

package
v0.0.0-...-410787f Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileStorage

func NewFileStorage(dir string, limit int64) (f *fileStorage, err error)

Types

type ByAccessTime

type ByAccessTime struct{ Files }

func (ByAccessTime) Less

func (f ByAccessTime) Less(i, j int) bool

type Error

type Error uint16
const (
	ErrFileNotFound Error = iota
)

func (Error) Error

func (e Error) Error() string

type File

type File struct {
	Filename   string
	AccessTime int64
	Size       int64
}

type Files

type Files []*File

func (Files) Len

func (f Files) Len() int

func (Files) Swap

func (f Files) Swap(i, j int)

type Storage

type Storage interface {
	SaveFile(hash string, reader io.Reader) error
	GetFile(hash string) (io.Reader, error)
	DeleteFile(hash string) error
}

Jump to

Keyboard shortcuts

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