s3

package
v3.54.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2025 License: AGPL-3.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OtherMethodArchive       = "archive"
	OtherMethodArchiveStatus = "archive_status"
	OtherMethodThaw          = "thaw"
	OtherMethodThawStatus    = "thaw_status"
)

Variables

This section is empty.

Functions

func DecodeOtherArgs added in v3.54.0

func DecodeOtherArgs(data interface{}, target interface{}) error

func NormalizeRestoreTier added in v3.54.0

func NormalizeRestoreTier(value string) string

func NormalizeStorageClass added in v3.54.0

func NormalizeStorageClass(value string) string

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."`
	StorageClass             string `` /* 254-byte string literal not displayed */
}

type ArchiveRequest added in v3.54.0

type ArchiveRequest struct {
	StorageClass string `json:"storage_class"`
}

type ArchiveResponse added in v3.54.0

type ArchiveResponse struct {
	Action       string           `json:"action"`
	Object       ObjectDescriptor `json:"object"`
	StorageClass string           `json:"storage_class"`
	RequestID    string           `json:"request_id,omitempty"`
	VersionID    string           `json:"version_id,omitempty"`
	ETag         string           `json:"etag,omitempty"`
	LastModified string           `json:"last_modified,omitempty"`
}

type Credentials added in v3.33.0

type Credentials struct {
	AccessKeyId     string `json:"accessKeyId,omitempty"`
	SecretAccessKey string `json:"secretAccessKey,omitempty"`
	SessionToken    string `json:"sessionToken,omitempty"`
}

type ObjectDescriptor added in v3.54.0

type ObjectDescriptor struct {
	Path   string `json:"path"`
	Bucket string `json:"bucket"`
	Key    string `json:"key"`
}

type RestoreStatus added in v3.54.0

type RestoreStatus struct {
	Ongoing bool   `json:"ongoing"`
	Expiry  string `json:"expiry,omitempty"`
	Raw     string `json:"raw"`
}

type S3

type S3 struct {
	model.Storage
	Addition
	Session *session.Session
	// contains filtered or unexported fields
}

func (*S3) Config

func (d *S3) Config() driver.Config

func (*S3) Copy

func (d *S3) Copy(ctx context.Context, srcObj, dstDir model.Obj) error

func (*S3) Drop

func (d *S3) Drop(ctx context.Context) error

func (*S3) GetAddition

func (d *S3) GetAddition() driver.Additional

func (*S3) Init

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 (*S3) List

func (d *S3) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*S3) MakeDir

func (d *S3) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error

func (*S3) Move

func (d *S3) Move(ctx context.Context, srcObj, dstDir model.Obj) error

func (*S3) Other added in v3.54.0

func (d *S3) Other(ctx context.Context, args model.OtherArgs) (interface{}, error)

func (*S3) Put

func (d *S3) Put(ctx context.Context, dstDir model.Obj, s model.FileStreamer, up driver.UpdateProgress) error

func (*S3) Remove

func (d *S3) Remove(ctx context.Context, obj model.Obj) error

func (*S3) Rename

func (d *S3) Rename(ctx context.Context, srcObj model.Obj, newName string) error

type ThawRequest added in v3.54.0

type ThawRequest struct {
	Days int64  `json:"days"`
	Tier string `json:"tier"`
}

type ThawResponse added in v3.54.0

type ThawResponse struct {
	Action    string           `json:"action"`
	Object    ObjectDescriptor `json:"object"`
	RequestID string           `json:"request_id,omitempty"`
	Status    *RestoreStatus   `json:"status,omitempty"`
}

type TmpTokenResponse added in v3.33.0

type TmpTokenResponse struct {
	Code int                  `json:"code"`
	Msg  string               `json:"msg"`
	Data TmpTokenResponseData `json:"data,omitempty"`
}

type TmpTokenResponseData added in v3.33.0

type TmpTokenResponseData struct {
	Credentials Credentials `json:"Credentials"`
	ExpiredAt   int         `json:"ExpiredAt"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL