Documentation ¶
Index ¶
- Constants
- type Controller
- func (c *Controller) AccessURL(ctx context.Context, name string, expire time.Duration, ...) (string, error)
- func (c *Controller) AuthSign(ctx context.Context, uploadID string, partNumbers []int) (*s3.AuthSignResult, error)
- func (c *Controller) CompleteUpload(ctx context.Context, uploadID string, partHashs []string) (*UploadResult, error)
- func (c *Controller) Engine() string
- func (c *Controller) FormData(ctx context.Context, name string, size int64, contentType string, ...) (*s3.FormData, error)
- func (c *Controller) GetHashObject(ctx context.Context, hash string) (*s3.ObjectInfo, error)
- func (c *Controller) HashPath(md5 string) string
- func (c *Controller) InitiateUpload(ctx context.Context, hash string, size int64, expire time.Duration, ...) (*InitiateUploadResult, error)
- func (c *Controller) IsNotFound(err error) bool
- func (c *Controller) NowPath() string
- func (c *Controller) PartLimit() *s3.PartLimit
- func (c *Controller) PartSize(ctx context.Context, size int64) (int64, error)
- func (c *Controller) StatObject(ctx context.Context, name string) (*s3.ObjectInfo, error)
- func (c *Controller) UUID() string
- type HashAlreadyExistsError
- type InitiateUploadResult
- type UploadResult
Constants ¶
View Source
const ( DirectPath = "openim/direct" UploadTypeMultipart = 1 // 分片上传 UploadTypePresigned = 2 // 预签名上传 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func (*Controller) AccessURL ¶
func (c *Controller) AccessURL(ctx context.Context, name string, expire time.Duration, opt *s3.AccessURLOption) (string, error)
func (*Controller) AuthSign ¶
func (c *Controller) AuthSign(ctx context.Context, uploadID string, partNumbers []int) (*s3.AuthSignResult, error)
func (*Controller) CompleteUpload ¶
func (c *Controller) CompleteUpload(ctx context.Context, uploadID string, partHashs []string) (*UploadResult, error)
func (*Controller) Engine ¶ added in v3.4.2
func (c *Controller) Engine() string
func (*Controller) GetHashObject ¶
func (c *Controller) GetHashObject(ctx context.Context, hash string) (*s3.ObjectInfo, error)
func (*Controller) HashPath ¶
func (c *Controller) HashPath(md5 string) string
func (*Controller) InitiateUpload ¶
func (c *Controller) InitiateUpload(ctx context.Context, hash string, size int64, expire time.Duration, maxParts int) (*InitiateUploadResult, error)
func (*Controller) IsNotFound ¶
func (c *Controller) IsNotFound(err error) bool
func (*Controller) NowPath ¶
func (c *Controller) NowPath() string
func (*Controller) PartLimit ¶
func (c *Controller) PartLimit() *s3.PartLimit
func (*Controller) StatObject ¶ added in v3.4.0
func (c *Controller) StatObject(ctx context.Context, name string) (*s3.ObjectInfo, error)
func (*Controller) UUID ¶
func (c *Controller) UUID() string
type HashAlreadyExistsError ¶
type HashAlreadyExistsError struct {
Object *s3.ObjectInfo
}
func (*HashAlreadyExistsError) Error ¶
func (e *HashAlreadyExistsError) Error() string
type InitiateUploadResult ¶
type InitiateUploadResult struct { UploadID string `json:"uploadID"` // 上传ID PartSize int64 `json:"partSize"` // 分片大小 Sign *s3.AuthSignResult `json:"sign"` // 分片信息 }
type UploadResult ¶
Click to show internal directories.
Click to hide internal directories.