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 { UploadPart(ctx context.Context, req *s3client.UploadPartRequest, payload []byte) error UploadPartWithPsk(ctx context.Context, req *s3client.UploadPartRequest, payload []byte, psk []byte) error CheckPartUploaded(ctx context.Context, req *s3client.UploadPartRequest) (bool, error) Checker(ctx context.Context, state *healthcheck.CheckState) error }
S3Client is an interface to represent methods called to action upon S3 (implemented by dp-s3)
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
Uploader represents the necessary configuration for uploading a file
func New ¶
func New(s3 S3Client, vc VaultClient, vaultPath, s3Region, s3Bucket string) *Uploader
New returns a new Uploader from the provided clients and vault path
func (*Uploader) CheckUploaded ¶
func (u *Uploader) CheckUploaded(w http.ResponseWriter, req *http.Request)
CheckUploaded checks to see if a chunk has been uploaded
type VaultClient ¶
type VaultClient interface { ReadKey(path, key string) (string, error) WriteKey(path, key, value string) error Checker(ctx context.Context, state *healthcheck.CheckState) error }
VaultClient is an interface to represent methods called to action upon vault (implemented by dp-vault)
Click to show internal directories.
Click to hide internal directories.