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 S3Clienter ¶ added in v1.0.0
type S3Clienter 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
}
S3Clienter defines the required method
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
Uploader represents the necessary configuration for uploading a file
func New ¶
func New(s3 S3Clienter, vc VaultClienter, 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 VaultClienter ¶ added in v1.0.0
type VaultClienter interface {
ReadKey(path, key string) (string, error)
WriteKey(path, key, value string) error
Checker(ctx context.Context, state *healthcheck.CheckState) error
}
VaultClienter defines the required method
Click to show internal directories.
Click to hide internal directories.