Documentation ¶
Index ¶
- func LogOff()
- func LogOn()
- func LogSet(l *hlog.Logger)
- type Bucket
- type Object
- func (o *Object) DownloadContent(ctx context.Context) ([]byte, error)
- func (o *Object) DownloadFile(ctx context.Context, fileName string) error
- func (o *Object) DownloadFileIfNewer(ctx context.Context, fileName string) error
- func (o *Object) DownloadStream(handler func(io.ReadCloser) error) error
- func (o *Object) Exist() error
- func (o *Object) SetContentType(contentType string)
- func (o *Object) SetDisableMultipart(disableMultipart bool)
- func (o *Object) SetProgressReporter(report ProgressReporter)
- func (o *Object) String() string
- func (o *Object) UploadContent(ctx context.Context, data []byte) error
- func (o *Object) UploadFile(ctx context.Context, fileName string) error
- func (o *Object) UploadFileWithMD5(ctx context.Context, fileName string, md5 string) error
- type ProgressReporter
- type Service
- type UploadProgress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket is a wrapper for Minio bucket.
func (*Bucket) ListObject ¶
ListObject lists all objects in the bucket.
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
Object is a wrapper for Minio object.
func (*Object) DownloadContent ¶
DownloadContent downloads the content of the object and returns in a slice of bytes.
func (*Object) DownloadFile ¶
DownloadFile downloads the object and saves as a file in the given path.
func (*Object) DownloadFileIfNewer ¶
DownloadFileIfNewer downloads the object and saves as a file in the given path if the file doesn't exist or has a different hash.
func (*Object) DownloadStream ¶
func (o *Object) DownloadStream(handler func(io.ReadCloser) error) error
func (*Object) SetContentType ¶
SetContentType sets ContentType of the object.
func (*Object) SetDisableMultipart ¶
SetDisableMultipart sets DisableMultipart of the object for uploading.
func (*Object) SetProgressReporter ¶
func (o *Object) SetProgressReporter(report ProgressReporter)
SetProgressReporter sets ProgressReporter of the object for downloading and uploading.
func (*Object) UploadContent ¶
UploadContent uploads the given data to the object.
func (*Object) UploadFile ¶
UploadFile uploads the given file to the object.
type ProgressReporter ¶
type ProgressReporter func(bytesTransferred int64)
ProgressReporter defines the signature of a callback function invoked as progress is reported.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a wrapper for Minio client.
func NewService ¶
NewService creates an instance for a minio client connected to a given minio server.
func (*Service) ListBucket ¶
ListBucket lists all buckets under the service.
type UploadProgress ¶
UploadProgress helps accumulate the progress of MinIO file upload
func NewUploadProgress ¶
func NewUploadProgress(reporter ProgressReporter) *UploadProgress
NewUploadProgress creates an instance for a minio upload progress fetcher