upload

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 12 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"`
	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"`
	TotalChunks      int    `schema:"resumableTotalChunks"`
	AliasName        string `schema:"aliasName"`
}

Resumable represents resumable js upload query pararmeters

type S3Client

type S3Client interface {
	S3SDKClient
	S3CryptoClient
}

S3Client wraps the SDK Client and the CryptoClients

type S3CryptoClient

type S3CryptoClient interface {
	UploadPartWithPSK(*s3.UploadPartInput, []byte) (*s3.UploadPartOutput, error)
}

S3CryptoClient represents the cryptoclient with methods required to upload parts with encryption

type S3SDKClient

type S3SDKClient interface {
	ListMultipartUploads(*s3.ListMultipartUploadsInput) (*s3.ListMultipartUploadsOutput, error)
	ListParts(*s3.ListPartsInput) (*s3.ListPartsOutput, error)
	CompleteMultipartUpload(input *s3.CompleteMultipartUploadInput) (*s3.CompleteMultipartUploadOutput, error)
	CreateMultipartUpload(*s3.CreateMultipartUploadInput) (*s3.CreateMultipartUploadOutput, error)
	UploadPart(*s3.UploadPartInput) (*s3.UploadPartOutput, error)
}

S3SDKClient represents the client with methods required to upload a multipart upload to s3

type Uploader

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

Uploader represents the necessary configuration for uploading a file

func New

func New(bucketName, vaultPath string, vc VaultClient) (*Uploader, error)

New creates a new instance of Uploader using provided s3 environment authentication

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

func (*Uploader) Upload

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

Upload handles the uploading a file to AWS s3

type VaultClient

type VaultClient interface {
	ReadKey(path, key string) (string, error)
	WriteKey(path, key, value string) error
}

VaultClient is an interface to represent methods called to action upon vault

Directories

Path Synopsis
Package mock_s3iface is a generated GoMock package.
Package mock_s3iface is a generated GoMock package.

Jump to

Keyboard shortcuts

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