Documentation
¶
Index ¶
- Constants
- func ReadUrlData(urlType UrlType, urlStr string) ([]byte, error)
- type CephClient
- func (cephClient *CephClient) CheckBucketExist(bucketName string) (bool, error)
- func (cephClient *CephClient) CreateBucket(bucketName string) error
- func (cephClient *CephClient) GetObjectUrl(bucketName, objectName string) (string, UrlType, error)
- func (cephClient *CephClient) ListBuckets() (*ListBucketsResult, error)
- func (cephClient *CephClient) ListObjects(bucketName, marker, prefix string) (*ListObjectsResult, error)
- func (cephClient *CephClient) UploadFile(urlType UrlType, urlStr, dstBucketName, dstObjectName string) error
- type CephConfig
- type ListBucketsResult
- type ListObjectsResult
- type LocalClient
- func (localClient *LocalClient) CheckBucketExist(dirName string) (bool, error)
- func (localClient *LocalClient) CreateBucket(dirName string) error
- func (localClient *LocalClient) GetObjectUrl(dirName, objectName string) (string, UrlType, error)
- func (localClient *LocalClient) ListBuckets() (*ListBucketsResult, error)
- func (localClient *LocalClient) ListObjects(dirName, marker, prefix string) (*ListObjectsResult, error)
- func (localClient *LocalClient) UploadFile(urlType UrlType, urlStr, dstBucketName, dstObjectName string) error
- type OssClient
- func (ossClient *OssClient) CheckBucketExist(bucketName string) (bool, error)
- func (ossClient *OssClient) CreateBucket(bucketName string) error
- func (ossClient *OssClient) GetObjectUrl(bucketName, objectName string) (string, UrlType, error)
- func (ossClient *OssClient) ListBuckets() (*ListBucketsResult, error)
- func (ossClient *OssClient) ListObjects(bucketName, marker, prefix string) (*ListObjectsResult, error)
- func (ossClient *OssClient) UploadFile(urlType UrlType, urlStr, dstBucketName, dstObjectName string) error
- type OssConfig
- type Store
- type UrlType
Constants ¶
View Source
const DefaultS3Region string = "us-east-1"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CephClient ¶
func NewCephClient ¶
func NewCephClient(cfg *CephConfig) (*CephClient, error)
func (*CephClient) CheckBucketExist ¶
func (cephClient *CephClient) CheckBucketExist(bucketName string) (bool, error)
func (*CephClient) CreateBucket ¶
func (cephClient *CephClient) CreateBucket(bucketName string) error
func (*CephClient) GetObjectUrl ¶
func (cephClient *CephClient) GetObjectUrl(bucketName, objectName string) (string, UrlType, error)
func (*CephClient) ListBuckets ¶
func (cephClient *CephClient) ListBuckets() (*ListBucketsResult, error)
func (*CephClient) ListObjects ¶
func (cephClient *CephClient) ListObjects(bucketName, marker, prefix string) (*ListObjectsResult, error)
func (*CephClient) UploadFile ¶
func (cephClient *CephClient) UploadFile(urlType UrlType, urlStr, dstBucketName, dstObjectName string) error
type CephConfig ¶
type ListBucketsResult ¶
type ListBucketsResult struct {
BucketNames []string
}
type ListObjectsResult ¶
type LocalClient ¶
type LocalClient struct { }
func NewLocalClient ¶
func NewLocalClient() (*LocalClient, error)
func (*LocalClient) CheckBucketExist ¶
func (localClient *LocalClient) CheckBucketExist(dirName string) (bool, error)
func (*LocalClient) CreateBucket ¶
func (localClient *LocalClient) CreateBucket(dirName string) error
func (*LocalClient) GetObjectUrl ¶
func (localClient *LocalClient) GetObjectUrl(dirName, objectName string) (string, UrlType, error)
func (*LocalClient) ListBuckets ¶
func (localClient *LocalClient) ListBuckets() (*ListBucketsResult, error)
func (*LocalClient) ListObjects ¶
func (localClient *LocalClient) ListObjects(dirName, marker, prefix string) (*ListObjectsResult, error)
func (*LocalClient) UploadFile ¶
func (localClient *LocalClient) UploadFile(urlType UrlType, urlStr, dstBucketName, dstObjectName string) error
type OssClient ¶
func NewOssClient ¶
func (*OssClient) CheckBucketExist ¶
func (*OssClient) CreateBucket ¶
func (*OssClient) GetObjectUrl ¶
func (*OssClient) ListBuckets ¶
func (ossClient *OssClient) ListBuckets() (*ListBucketsResult, error)
func (*OssClient) ListObjects ¶
func (ossClient *OssClient) ListObjects(bucketName, marker, prefix string) (*ListObjectsResult, error)
type Store ¶
type Store interface { ListBuckets() (*ListBucketsResult, error) CheckBucketExist(bucketName string) (bool, error) CreateBucket(bucketName string) error UploadFile(urlType UrlType, urlStr, dstBucketName, dstObjectName string) error GetObjectUrl(bucketName, objectName string) (string, UrlType, error) ListObjects(bucketName, marker, prefix string) (*ListObjectsResult, error) }
Click to show internal directories.
Click to hide internal directories.