Documentation
¶
Index ¶
- Constants
- type Addition
- type Credentials
- type S3
- func (d *S3) Config() driver.Config
- func (d *S3) Copy(ctx context.Context, srcObj, dstDir model.Obj) error
- func (d *S3) Drop(ctx context.Context) error
- func (d *S3) GetAddition() driver.Additional
- func (d *S3) GetDirectUploadInfo(ctx context.Context, _ string, dstDir model.Obj, fileName string, _ int64) (any, error)
- func (d *S3) GetDirectUploadTools() []string
- func (d *S3) Init(ctx context.Context) error
- func (d *S3) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
- func (d *S3) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
- func (d *S3) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error
- func (d *S3) Move(ctx context.Context, srcObj, dstDir model.Obj) error
- func (d *S3) Put(ctx context.Context, dstDir model.Obj, s model.FileStreamer, ...) error
- func (d *S3) Remove(ctx context.Context, obj model.Obj) error
- func (d *S3) Rename(ctx context.Context, srcObj model.Obj, newName string) error
- type TmpTokenResponse
- type TmpTokenResponseData
Constants ¶
View Source
const ( ClientTypeNormal = iota ClientTypeLink ClientTypeDirectUpload )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addition ¶
type Addition struct {
driver.RootPath
Bucket string `json:"bucket" required:"true"`
Endpoint string `json:"endpoint" required:"true"`
Region string `json:"region"`
AccessKeyID string `json:"access_key_id" required:"true"`
SecretAccessKey string `json:"secret_access_key" required:"true"`
SessionToken string `json:"session_token"`
CustomHost string `json:"custom_host"`
EnableCustomHostPresign bool `json:"enable_custom_host_presign"`
SignURLExpire int `json:"sign_url_expire" type:"number" default:"4"`
Placeholder string `json:"placeholder"`
ForcePathStyle bool `json:"force_path_style"`
ListObjectVersion string `json:"list_object_version" type:"select" options:"v1,v2" default:"v1"`
RemoveBucket bool `json:"remove_bucket" help:"Remove bucket name from path when using custom host."`
AddFilenameToDisposition bool `json:"add_filename_to_disposition" help:"Add filename to Content-Disposition header."`
EnableDirectUpload bool `json:"enable_direct_upload" default:"false"`
DirectUploadHost string `json:"direct_upload_host" required:"false"`
}
type Credentials ¶
type S3 ¶
type S3 struct {
model.Storage
Addition
Session *session.Session
// contains filtered or unexported fields
}
func (*S3) GetAddition ¶
func (d *S3) GetAddition() driver.Additional
func (*S3) GetDirectUploadInfo ¶ added in v4.1.8
func (*S3) GetDirectUploadTools ¶ added in v4.1.8
type TmpTokenResponse ¶
type TmpTokenResponse struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data TmpTokenResponseData `json:"data,omitempty"`
}
type TmpTokenResponseData ¶
type TmpTokenResponseData struct {
Credentials Credentials `json:"Credentials"`
ExpiredAt int `json:"ExpiredAt"`
}
Click to show internal directories.
Click to hide internal directories.