disk

package
v0.0.0-...-1eb86f4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package disk provides source storage that stores files on disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Dir string // Directory to store files in.
	// contains filtered or unexported fields
}

Storage is a local source repository that stores files on disk.

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, filename string) (io.ReadCloser, error)

Get returns a source file. The caller is responsible for closing the file.

func (*Storage) Has

func (s *Storage) Has(ctx context.Context, filename string) (bool, error)

Has returns true if the given filename exists in the source storage.

func (*Storage) ListenAndServe

func (s *Storage) ListenAndServe() error

ListenAndServe starts a HTTP server on an OS-assigned port and starts accepting uploads.

func (*Storage) NewUpload

func (s *Storage) NewUpload(cfg source.UploadConfig) (*source.UploadURL, error)

NewUpload creates a new upload url that the local source repo will accept.

Jump to

Keyboard shortcuts

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