storage

package
v0.0.0-...-597ad08 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct{}

func New

func New() *Client

func (Client) LocalDelete

func (Client) LocalDelete(relativeFilePath string) error

LocalDelete Deletes a file using the provided path relative to the local backups directory.

func (Client) LocalGetFullPath

func (Client) LocalGetFullPath(relativeFilePath string) string

LocalGetFullPath Returns the full path of a file using the provided relative file path to the local backups directory.

func (Client) LocalUpload

func (Client) LocalUpload(relativeFilePath string, fileReader io.Reader) (int64, error)

LocalUpload Creates a new file using the provided path and reader relative to the local backups directory.

Returns the size of the file created, in bytes.

func (Client) S3Delete

func (Client) S3Delete(
	accessKey, secretKey, region, endpoint, bucketName, key string,
) error

S3Delete deletes a file from S3

func (Client) S3GetDownloadLink(
	accessKey, secretKey, region, endpoint, bucketName, key string,
	expiration time.Duration,
) (string, error)

S3GetDownloadLink generates a presigned URL for downloading a file from S3

func (Client) S3Test

func (Client) S3Test(
	accessKey, secretKey, region, endpoint, bucketName string,
) error

S3Test tests the connection to S3

func (Client) S3Upload

func (Client) S3Upload(
	accessKey, secretKey, region, endpoint, bucketName, key string,
	fileReader io.Reader,
) (int64, error)

S3Upload uploads a file to S3 from a reader.

Returns the file size, in bytes.

Jump to

Keyboard shortcuts

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