Documentation ¶
Index ¶
- Variables
- func WithChunkSize(s int64) packageOption
- func WithConcurrency(c int) packageOption
- func WithRetries(r uint) packageOption
- type File
- type FileInfo
- type FilePart
- type FileUpload
- type FinalizeInfo
- type HostedDropzoneInfo
- type Package
- func (p *Package) AddFileToPackage(file *os.File) (*File, error)
- func (p *Package) Encrypt(unencryptedFilePart io.Reader) (*bytes.Buffer, error)
- func (p *Package) FinalizePackage() error
- func (p *Package) GetUploadURLs(file *File) error
- func (p *Package) MarkFileComplete(file *File) error
- func (p *Package) SubmitHostedDropzone(name string, email string) error
- func (p *Package) UploadFileParts(file *File) error
- type PackageInfo
- type RequestInfo
- type SSResponse
- type UploadURL
- type UploadUrlInfo
- type Uploader
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultChunkSize int64 = 2.5 * units.MiB
DefaultChunkSize is 2.5 MB, recommended by sendsafely
Functions ¶
func WithChunkSize ¶
func WithChunkSize(s int64) packageOption
func WithConcurrency ¶
func WithConcurrency(c int) packageOption
func WithRetries ¶
func WithRetries(r uint) packageOption
Types ¶
type FileInfo ¶
type FileInfo struct { ID string `json:"fileId"` Name string `json:"fileName"` Size int64 `json:"fileSize,omitempty,string"` Parts int `json:"parts"` Uploaded string `json:"fileUploaded"` UploadedStr string `json:"fileUploadedStr"` Version string `json:"fileVersion"` CreatedByEmail string `json:"createdByEmail"` SSResponse }
type FileUpload ¶
type FinalizeInfo ¶
type FinalizeInfo struct { NeedsLink bool `json:"needsLink"` SSResponse }
type HostedDropzoneInfo ¶
type HostedDropzoneInfo struct { Success string `json:"success"` Data string `json:"data"` Digest string `json:"digest"` IntegrationURLs []string `json:"integrationUrls"` SSResponse }
type Package ¶
type Package struct { Uploader *Uploader Info PackageInfo URL string Checksum string Files []*File ChunkSize int64 Concurrency int Retries uint // contains filtered or unexported fields }
func (*Package) AddFileToPackage ¶
Given a file object, 1) Get file split parts - # of parts and chunk size 2) get upload URLs for those chunks 3) read the chunks, pipe thru encryption 4) upload the file to the URL
func (*Package) FinalizePackage ¶
FinalizePackage marks the package complete and returns a link to the package, or the error if package finalization did not succeed. Sets Package.URL on success
func (*Package) GetUploadURLs ¶
Sets the upload URLs for the file parts in the provided file pointer only 25 part urls are returned - so if more than that are required, retry
func (*Package) MarkFileComplete ¶
func (*Package) SubmitHostedDropzone ¶
func (*Package) UploadFileParts ¶
type PackageInfo ¶
type PackageInfo struct { PackageID string `json:"packageId"` PackageCode string `json:"packageCode"` ServerSecret string `json:"serverSecret"` SSResponse }
type RequestInfo ¶
type SSResponse ¶
type UploadUrlInfo ¶
type UploadUrlInfo struct { URLS []UploadURL `json:"uploadUrls"` SSResponse }
Click to show internal directories.
Click to hide internal directories.