Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct { Type string `yaml:"type"` Addr string `yaml:"addr"` ExternalAddr string `yaml:"external_addr"` Secure bool `yaml:"secure"` AccessKey string `yaml:"access_key"` SecretKey string `yaml:"secret_key"` ExpiryDuration int `yaml:"expiry_duration"` BucketName string `yaml:"bucket_name"` Region string `yaml:"region"` }
type GetObjectOption ¶
type GetObjectOption struct {
// contains filtered or unexported fields
}
func (*GetObjectOption) GetRange ¶
func (opt *GetObjectOption) GetRange() *Range
func (*GetObjectOption) SetRange ¶
func (opt *GetObjectOption) SetRange(start, end int64)
type ObjectInfo ¶
type ObjectInfo struct {
Size int64 `json:"size"`
}
type Oss ¶
type Oss interface { ExternalAddr() string PresignedPutURL(ctx context.Context, objectName string, expires time.Duration, etag, mimeType string, size int64) (string, error) PresignedGetURL(ctx context.Context, objectName string, expires time.Duration) (string, error) StatObject(ctx context.Context, objectName string) (ObjectInfo, error) PutObject(ctx context.Context, objectName string, reader io.Reader, objectSize int64, contentType string) error GetBucketName() string GetObject(ctx context.Context, objectName string, opts GetObjectOption) (io.Reader, error) DeleteObject(ctx context.Context, objectName string) error }
Click to show internal directories.
Click to hide internal directories.