s3

package
v0.0.0-...-1b0f315 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CopyObjectParams

type CopyObjectParams struct {
	Bucket string
	SrcKey string
	DstKey string
}

type DeleteObjectParams

type DeleteObjectParams struct {
	Bucket string
	Key    string
}

type FileStorage

type FileStorage struct {
	// contains filtered or unexported fields
}

func NewFileStorage

func NewFileStorage(c FileStorageConfig) *FileStorage

func (*FileStorage) Copy

func (s *FileStorage) Copy(src, dst media.Path) error

func (*FileStorage) Delete

func (s *FileStorage) Delete(p media.Path) error

func (*FileStorage) Download

func (s *FileStorage) Download(p media.Path) (*media.DownloadResult, error)

func (*FileStorage) DownloadMultiple

func (s *FileStorage) DownloadMultiple(paths []media.Path) ([]*media.DownloadResult, error)

func (*FileStorage) Get

func (s *FileStorage) Get(p media.Path) (*media.FileInfo, error)

func (*FileStorage) GetMultiple

func (s *FileStorage) GetMultiple(p media.Path) ([]media.FileInfo, error)

func (*FileStorage) Move

func (s *FileStorage) Move(src, dst media.Path) error

func (*FileStorage) SpaceUsage

func (s *FileStorage) SpaceUsage() (int64, error)

func (*FileStorage) Upload

func (s *FileStorage) Upload(in media.UploadInput) error

type FileStorageConfig

type FileStorageConfig struct {
	S3     *S3
	Bucket string
}

type GetObjectParams

type GetObjectParams struct {
	Bucket string
	Key    string
}

type ListObjectsParams

type ListObjectsParams struct {
	Bucket string
	Prefix string
}

type MoveObjectParams

type MoveObjectParams struct {
	Bucket string
	SrcKey string
	DstKey string
}

type PutObjectParams

type PutObjectParams struct {
	Bucket        string
	Key           string
	Body          io.Reader
	ContentType   string
	ContentLength int64
	Metadata      map[string]*string
}

type S3

type S3 struct {
	S3Config
	// contains filtered or unexported fields
}

func NewS3

func NewS3(config S3Config) *S3

func (*S3) CopyObject

func (s *S3) CopyObject(p CopyObjectParams) error

func (*S3) DeleteObject

func (s *S3) DeleteObject(p DeleteObjectParams) error

func (*S3) DownloadObject

func (s *S3) DownloadObject(p GetObjectParams) (io.ReadCloser, *string, *int64, error)

func (*S3) GetObject

func (s *S3) GetObject(p GetObjectParams) (*S3Object, error)

func (*S3) ListObjects

func (s *S3) ListObjects(p ListObjectsParams) ([]S3Object, error)

func (*S3) PutObject

func (s *S3) PutObject(p PutObjectParams) error

func (*S3) RenameObject

func (s *S3) RenameObject(p MoveObjectParams) error

type S3Config

type S3Config struct {
	AccessKeyId     string
	SecretAccessKey string
	Endpoint        string
	Region          string
}

type S3Object

type S3Object struct {
	Key           string
	ContentType   string
	ContentLength int64
	Metadata      map[string]*string
}

type SpaceUsageParams

type SpaceUsageParams struct {
	Bucket string
	Prefix string
}

Jump to

Keyboard shortcuts

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