upload

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resumable

type Resumable struct {
	ChunkNumber      int    `schema:"resumableChunkNumber"`
	TotalChunks      int    `schema:"resumableTotalChunks"`
	ChunkSize        int    `schema:"resumableChunkSize"`
	CurrentChunkSize int    `schema:"resumableCurrentChunkSize"`
	TotalSize        int    `schema:"resumableTotalSize"`
	Type             string `schema:"resumableType"`
	Identifier       string `schema:"resumableIdentifier"`
	FileName         string `schema:"resumableFilename"`
	RelativePath     string `schema:"resumableRelativePath"`
	AliasName        string `schema:"aliasName"`
}

Resumable represents resumable js upload query pararmeters

type Uploader

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

Uploader represents the necessary configuration for uploading a file

func New

func New(bucket *aws.Bucket) *Uploader

New returns a new Uploader from the provided clients

func (*Uploader) CheckUploaded

func (u *Uploader) CheckUploaded(w http.ResponseWriter, req *http.Request)

CheckUploaded checks to see if a chunk has been uploaded

func (*Uploader) GetS3URL

func (u *Uploader) GetS3URL(w http.ResponseWriter, req *http.Request)

GetS3URL returns an S3 URL for a requested path, and the client's region and bucket name. Path corresponds to the S3 object key

func (*Uploader) Upload

func (u *Uploader) Upload(w http.ResponseWriter, req *http.Request)

Upload handles the uploading of a file to AWS s3

Jump to

Keyboard shortcuts

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