storage

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S3

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

func NewS3

func NewS3(
	client *s3.Client,
	bucket string,
	rootFolder string,
	url string,
	logger *logrus.Logger,
) *S3

func (*S3) CreatePresignedURL

func (s *S3) CreatePresignedURL(
	ctx context.Context,
	filepath string,
	expire time.Duration,
) (string, *controller.APIError)

func (*S3) DeleteFile

func (s *S3) DeleteFile(ctx context.Context, filepath string) *controller.APIError

func (*S3) GetFile

func (s *S3) GetFile(
	ctx context.Context,
	filepath string,
	headers http.Header,
) (*controller.File, *controller.APIError)

func (*S3) GetFileWithPresignedURL added in v0.1.1

func (s *S3) GetFileWithPresignedURL(
	ctx context.Context, filepath, signature string, headers http.Header,
) (*controller.File, *controller.APIError)

func (*S3) ListFiles

func (s *S3) ListFiles(ctx context.Context) ([]string, *controller.APIError)

func (*S3) PutFile

func (s *S3) PutFile(
	ctx context.Context,
	content io.ReadSeeker,
	filepath string,
	contentType string,
) (string, *controller.APIError)

type S3Error added in v0.1.1

type S3Error struct {
	Code    string `xml:"Code"`
	Message string `xml:"Message"`
}

Jump to

Keyboard shortcuts

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