upload

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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" validate:"required"`
	TotalChunks      int    `schema:"resumableTotalChunks" validate:"required"`
	ChunkSize        int    `schema:"resumableChunkSize" validate:"required"`
	CurrentChunkSize int    `schema:"resumableCurrentChunkSize" validate:"required"`
	TotalSize        int    `schema:"resumableTotalSize" validate:"required"`
	Type             string `schema:"resumableType" validate:"required"`
	Identifier       string `schema:"resumableIdentifier" validate:"required"`
	FileName         string `schema:"resumableFilename" validate:"required"`
	RelativePath     string `schema:"resumableRelativePath" validate:"required"`
	AliasName        string `schema:"aliasName" validate:"required"`
}

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 godoc @Description checks to see if a chunk has been uploaded @Tags upload @Accept json @Produce json @Param request formData Resumable false "Resumable" @Success 200 @Failure 400 @Failure 404 @Failure 500 @Router /upload [get]

func (*Uploader) GetS3URL

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

GetS3URL godoc @Description returns an S3 URL for a requested path, and the client's region and bucket name @Tags upload @Accept json @Produce json @Param id path string true "S3 object key" @Success 200 @Failure 400 @Failure 404 @Failure 500 @Router /upload/{id} [get]

func (*Uploader) Upload

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

Upload godoc @Description handles the uploading of a file to AWS s3 @Tags upload @Accept json @Produce json @Param request formData Resumable false "Resumable" @Success 200 @Failure 400 @Failure 404 @Failure 500 @Router /upload [post]

Jump to

Keyboard shortcuts

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