handlers

package
Version: v0.0.0-...-2a2240e Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2018 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChannelReader

func NewChannelReader(reader io.ReadCloser) *channelReader

Types

type Downloader

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

func NewDownloader

func NewDownloader(keyFetcher KeyFetcher) *Downloader

func (*Downloader) ServeHTTP

func (d *Downloader) ServeHTTP(w http.ResponseWriter, r *http.Request)

type KeyFetcher

type KeyFetcher interface {
	Fetch(key string) *ReadLocker
}

type KeyStorage

type KeyStorage interface {
	Add(key string, data io.Reader) error
	Delete(key string)
}

type KeyStorer

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

func NewKeyStorer

func NewKeyStorer() *KeyStorer

func (*KeyStorer) Add

func (k *KeyStorer) Add(key string, reader io.Reader) error

func (*KeyStorer) Delete

func (k *KeyStorer) Delete(key string)

func (*KeyStorer) Fetch

func (k *KeyStorer) Fetch(key string) *ReadLocker

type Locker

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

func NewLocker

func NewLocker() *Locker

func (*Locker) TryLock

func (l *Locker) TryLock() bool

func (*Locker) Unlock

func (l *Locker) Unlock()

type ReadLocker

type ReadLocker struct {
	Lock   *Locker
	Reader io.Reader
}

type Uploader

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

func NewUploader

func NewUploader(keyStorage KeyStorage, timeout time.Duration) *Uploader

func (*Uploader) ServeHTTP

func (u *Uploader) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL