Documentation ¶
Index ¶
- func SetGlobal(h func() IClient)
- type IClient
- type MinioClient
- func (c *MinioClient) GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, error)
- func (c *MinioClient) PutObject(ctx context.Context, bucketName, objectName string, reader io.ReadSeeker, ...) (*PutObjectResult, error)
- func (c *MinioClient) RemoveObject(ctx context.Context, bucketName, objectName string) error
- func (c *MinioClient) RemoveObjectByURL(ctx context.Context, urlStr string) error
- func (c *MinioClient) StatObject(ctx context.Context, bucketName, objectName string) (*ObjectStat, error)
- func (c *MinioClient) StatObjectByURL(ctx context.Context, urlStr string) (*ObjectStat, error)
- type MinioClientConfig
- type ObjectStat
- type PutObjectOptions
- type PutObjectResult
- type S3Client
- func (c *S3Client) GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, error)
- func (c *S3Client) PutObject(ctx context.Context, bucketName, objectName string, reader io.ReadSeeker, ...) (*PutObjectResult, error)
- func (c *S3Client) RemoveObject(ctx context.Context, bucketName, objectName string) error
- func (c *S3Client) RemoveObjectByURL(ctx context.Context, urlStr string) error
- func (c *S3Client) StatObject(ctx context.Context, bucketName, objectName string) (*ObjectStat, error)
- func (c *S3Client) StatObjectByURL(ctx context.Context, urlStr string) (*ObjectStat, error)
- type S3ClientConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IClient ¶
type IClient interface { PutObject(ctx context.Context, bucketName, objectName string, reader io.ReadSeeker, objectSize int64, options ...PutObjectOptions) (*PutObjectResult, error) GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, error) RemoveObject(ctx context.Context, bucketName, objectName string) error RemoveObjectByURL(ctx context.Context, urlStr string) error StatObject(ctx context.Context, bucketName, objectName string) (*ObjectStat, error) StatObjectByURL(ctx context.Context, urlStr string) (*ObjectStat, error) }
IClient is an interface for oss client
var (
Ins IClient
)
type MinioClient ¶
type MinioClient struct {
// contains filtered or unexported fields
}
func NewMinioClient ¶
func NewMinioClient(config MinioClientConfig) (*MinioClient, error)
func (*MinioClient) GetObject ¶
func (c *MinioClient) GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, error)
func (*MinioClient) PutObject ¶
func (c *MinioClient) PutObject(ctx context.Context, bucketName, objectName string, reader io.ReadSeeker, objectSize int64, options ...PutObjectOptions) (*PutObjectResult, error)
func (*MinioClient) RemoveObject ¶
func (c *MinioClient) RemoveObject(ctx context.Context, bucketName, objectName string) error
func (*MinioClient) RemoveObjectByURL ¶
func (c *MinioClient) RemoveObjectByURL(ctx context.Context, urlStr string) error
func (*MinioClient) StatObject ¶
func (c *MinioClient) StatObject(ctx context.Context, bucketName, objectName string) (*ObjectStat, error)
func (*MinioClient) StatObjectByURL ¶
func (c *MinioClient) StatObjectByURL(ctx context.Context, urlStr string) (*ObjectStat, error)
type MinioClientConfig ¶
type ObjectStat ¶
type ObjectStat struct { Key string ETag string LastModified time.Time Size int64 ContentType string UserMetadata map[string]string }
func (*ObjectStat) GetName ¶
func (a *ObjectStat) GetName() string
type PutObjectOptions ¶
PutObjectOptions represents options specified by user for PutObject call
type PutObjectResult ¶
type S3Client ¶
type S3Client struct {
// contains filtered or unexported fields
}
func NewS3Client ¶
func NewS3Client(config S3ClientConfig) (*S3Client, error)
func (*S3Client) PutObject ¶
func (c *S3Client) PutObject(ctx context.Context, bucketName, objectName string, reader io.ReadSeeker, objectSize int64, options ...PutObjectOptions) (*PutObjectResult, error)
func (*S3Client) RemoveObject ¶
func (*S3Client) RemoveObjectByURL ¶
func (*S3Client) StatObject ¶
func (*S3Client) StatObjectByURL ¶
Click to show internal directories.
Click to hide internal directories.