upload

package
v0.0.0-...-424a8ae Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVImporter

type CSVImporter struct{}

func (*CSVImporter) Import

func (i *CSVImporter) Import(up *Upload) (*Data, error)

type Data

type Data struct {
	Names []string
	Data  [][]string
}

func (*Data) Size

func (d *Data) Size() int

type FileSystem

type FileSystem struct{}

func (*FileSystem) UploadTaskData

func (s *FileSystem) UploadTaskData(up *Upload, userID uint64, draftID bson.ObjectId) (string, error)

type GCloud

type GCloud struct{}

func (*GCloud) UploadTaskData

func (s *GCloud) UploadTaskData(up *Upload, userID uint64, draftID bson.ObjectId) (string, error)

type ImageImporter

type ImageImporter struct{}

func (*ImageImporter) Import

func (i *ImageImporter) Import(up *Upload) error

type ImgImporter

type ImgImporter interface {
	Import(*Upload) error
}

type Importer

type Importer interface {
	Import(*Upload) (*Data, error)
}

type MIME

type MIME string
const CSV MIME = "text/csv"
const JPEG MIME = "image/jpeg"
const JPG MIME = "image/jpg"
const PNG MIME = "image/png"

func (MIME) Equals

func (m MIME) Equals(n string) bool

type Storage

type Storage interface {
	UploadTaskData(*Upload, uint64, bson.ObjectId) (string, error)
}

type Upload

type Upload struct {
	MIME          MIME
	ImportReader  io.Reader
	StorageReader io.Reader
	PipeCloser    io.Closer
	FileCloser    io.Closer
}

func NewUpload

func NewUpload(header *multipart.FileHeader) (*Upload, error)

func (*Upload) Close

func (u *Upload) Close()

Jump to

Keyboard shortcuts

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