s3

package
v0.0.0-...-55670f9 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

Types

type ClientAPI

type ClientAPI interface {
	GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
	PutObject(ctx context.Context, params *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error)
	CopyObject(ctx context.Context, params *s3.CopyObjectInput, optFns ...func(*s3.Options)) (*s3.CopyObjectOutput, error)
	DeleteObject(ctx context.Context, params *s3.DeleteObjectInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectOutput, error)
	HeadObject(ctx context.Context, params *s3.HeadObjectInput, optFns ...func(*s3.Options)) (*s3.HeadObjectOutput, error)
	ListObjectsV2(ctx context.Context, params *s3.ListObjectsV2Input, optFns ...func(*s3.Options)) (*s3.ListObjectsV2Output, error)
}

type Name

type Name struct {
	Bucket string
	Key    string
}

func SplitName

func SplitName(s string) (*Name, error)

func (*Name) String

func (n *Name) String() string

type S3

type S3 struct {
	Client ClientAPI
	// contains filtered or unexported fields
}

func (*S3) Copy

func (s *S3) Copy(from, to string) error

func (*S3) Delete

func (s *S3) Delete(name string) error

func (*S3) Exists

func (s *S3) Exists(name string) (bool, error)

func (*S3) Get

func (s *S3) Get(name string) ([]byte, error)

func (*S3) List

func (s *S3) List(name string) ([]*filestorage.FileStats, error)

func (*S3) Save

func (s *S3) Save(name string, data []byte) error

func (*S3) Stats

func (s *S3) Stats(name string) (*filestorage.FileStats, error)

Jump to

Keyboard shortcuts

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