Documentation
¶
Index ¶
- func DisableAuthCheck(cmd *cobra.Command)
- func DownloadFileThroughUrl(file string, downloadUrl string)
- func IsAuthCheckEnabled(cmd *cobra.Command) bool
- func UploadFileThroughUrl(um *UploadManager, file string, uploadUrl string) error
- type Progress
- type UploadManager
- func (u *UploadManager) AddUploadedFile(name string)
- func (u *UploadManager) FMultipartPutObject(ctx context.Context, bucket string, key string, filePath string, ...) (err error)
- func (u *UploadManager) FPutObject(absPath string, bucket string, key string, sha256 string, ...) error
- func (u *UploadManager) Wait()
- type UploadManagerErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableAuthCheck ¶
func DownloadFileThroughUrl ¶
DownloadFileThroughUrl downloads a single file from the given downloadUrl. file is the absolute path of the file to be downloaded. downloadUrl is the pre-signed url to download the file from.
func IsAuthCheckEnabled ¶
func UploadFileThroughUrl ¶
func UploadFileThroughUrl(um *UploadManager, file string, uploadUrl string) error
UploadFileThroughUrl uploads a single file to the given uploadUrl. um is the upload manager to use. file is the absolute path of the file to be uploaded. uploadUrl is the pre-signed url to upload the file to.
Types ¶
type Progress ¶
Progress is a simple struct to keep track of the progress of a file upload/download
type UploadManager ¶
type UploadManager struct {
Errs []UploadManagerErr
sync.WaitGroup
// contains filtered or unexported fields
}
UploadManager is a manager for uploading files through minio client. Note that it's user's responsibility to check the Errs field after Wait() to see if there's any error.
func NewUploadManager ¶
func NewUploadManager(client *minio.Client) (*UploadManager, error)
func (*UploadManager) AddUploadedFile ¶
func (u *UploadManager) AddUploadedFile(name string)
AddUploadedFile sends a message to status monitor to add uploaded file.
func (*UploadManager) FMultipartPutObject ¶
func (u *UploadManager) FMultipartPutObject(ctx context.Context, bucket string, key string, filePath string, fileSize int64, opts minio.PutObjectOptions) (err error)
func (*UploadManager) FPutObject ¶
func (u *UploadManager) FPutObject(absPath string, bucket string, key string, sha256 string, userTags map[string]string) error
FPutObject uploads a file to a bucket with a key and sha256. If the file size is larger than minPartSize, it will use multipart upload.
func (*UploadManager) Wait ¶
func (u *UploadManager) Wait()
Wait waits for all uploads to finish. And wait for status monitor to finish.