Documentation ¶
Index ¶
- Constants
- type MinioClient
- type Storage
- func (s *Storage) CheckURL(objectURL string) (string, error)
- func (s *Storage) CopyFile(srcURL string, objectURL string) error
- func (s *Storage) Download(objectURL string, localPath string) (string, error)
- func (s *Storage) IsLocalURL(srcURL string) (bool, error)
- func (s *Storage) SetCredential(credential string) error
- func (s *Storage) Upload(localPath string, objectURL string) error
Constants ¶
View Source
const ( // S3Prefix defines that prefix of url is s3 S3Prefix = "s3" // LocalPrefix defines that prefix of url is local host LocalPrefix = "" // S3EndPoint is s3 endpoint of the storage service S3Endpoint = "s3-endpoint" // S3UseHTTPS determines whether to use HTTPS protocol S3UseHTTPS = "s3-usehttps" // AccessKeyId is access key id of the storage service AccessKeyID = "ACCESS_KEY_ID" // SecretAccessKey is secret access key of the storage service SecretAccessKey = "SECRET_ACCESS_KEY" )
View Source
const MaxTimeOut = 100 * time.Second
MaxTimeOut is max deadline time of client working
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MinioClient ¶
type MinioClient struct {
Client *minio.Client
}
MinioClient defines a minio client
type Storage ¶
type Storage struct { MinioClient *MinioClient IsLocalStorage bool }
func (*Storage) IsLocalURL ¶
IsLocalURL checks whether the url is local url
func (*Storage) SetCredential ¶
SetCredential sets credential of the storage service
Click to show internal directories.
Click to hide internal directories.