Documentation
¶
Index ¶
Constants ¶
View Source
const ( TypeMinio = StorageType("minio") TypeDisk = StorageType("disk") )
Variables ¶
This section is empty.
Functions ¶
func NewBufferFromMultipart ¶ added in v0.0.36
func NewBufferFromMultipart(params multipart.FileHeader) (*bytes.Buffer, error)
Types ¶
type Interface ¶
type Interface interface {
// Put a file to storage.
//
// Errors:
//
// - `codes.CodeStorageNoFile`: if failed to put file to storage.
Put(ctx context.Context, params PutParams) (PutResult, error)
// Delete data from storage.
//
// Errors:
//
// - `codes.CodeStorageDelFailure`: if cannot delete file.
Del(ctx context.Context, params DelParams) error
// Generate url based on given full path of file.
//
// Errors:
//
// - `codes.CodeStorageGenerateURLFailure`: if failed on generate url.
Url(ctx context.Context, params UrlParams) (UrlResult, error)
}
type PutParams ¶
type PutParams struct {
DirName string
FileName string
FileBuffer io.Reader
FileSize int64
ContentType string
ContentEncoding string
UserTags, UserMetadata map[string]string
}
func NewPutParamsFromMultipart ¶ added in v0.0.36
func NewPutParamsFromMultipart(dir string, params multipart.FileHeader) (PutParams, error)
type StorageType ¶ added in v0.0.25
type StorageType string
Click to show internal directories.
Click to hide internal directories.