local

package
v0.0.0-...-6e9cc21 Latest Latest
Warning

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

Go to latest
Published: May 6, 2017 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileService

type FileService struct {
	Path          string
	GenerateToken func() string
}

FileService represents a service for serving files from the local filesystem.

func NewFileService

func NewFileService() *FileService

NewFileService returns a new instance of FileService.

func (*FileService) CreateFile

func (s *FileService) CreateFile(ctx context.Context, f *peapod.File, r io.Reader) error

CreateFile creates a new file with the contents of r.

func (*FileService) FindFileByName

func (s *FileService) FindFileByName(ctx context.Context, name string) (*peapod.File, io.ReadCloser, error)

FindFileByName returns a file and a reader to its contents. The read must be closed by the caller.

func (*FileService) GenerateName

func (s *FileService) GenerateName(ext string) string

GenerateName returns a randomly generated name with the given extension.

Jump to

Keyboard shortcuts

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