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 S3Cache
- type UploadResult
Constants ¶
View Source
const ( // DirectPath indicates the directory for direct uploads or access within the 'openim' structure. DirectPath = "openim/direct" // UploadTypeMultipart represents the identifier for multipart uploads, // allowing large files to be uploaded in chunks. UploadTypeMultipart = 1 // UploadTypePresigned signifies the use of presigned URLs for uploads, // facilitating secure, authorized file transfers without requiring direct access to the storage credentials. 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 ¶
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 ¶
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 uniquely identifies the upload session for tracking and management purposes. UploadID string `json:"uploadID"` // PartSize specifies the size of each part in a multipart upload. This is relevant for breaking down large uploads into manageable pieces. PartSize int64 `json:"partSize"` // Sign contains the authentication and signature information necessary for securely uploading each part. This could include signed URLs or tokens. Sign *s3.AuthSignResult `json:"sign"` }
type UploadResult ¶
Click to show internal directories.
Click to hide internal directories.