storage

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFile

func DeleteFile(ctx context.Context, bucket, key string) error

DeleteFile deletes a file from the storage provider.

ctx: the context for the operation. bucket: the storage bucket from which the file is deleted. key: the key or identifier of the file to be deleted. Returns an error.

func DownloadFile added in v0.0.4

func DownloadFile(ctx context.Context, bucket, key string) (*os.File, error)

DownloadFile downloads a file from the storage provider.

ctx: the context for the operation. bucket: the storage bucket from which the file is downloaded. key: the key or identifier of the file to be downloaded. Returns a file pointer and an error.

func Initialize

func Initialize()

Initialize initializes the storage provider based on the configured cloud.

No parameters. No return values.

func UploadFile

func UploadFile(ctx context.Context, bucket, key string, file *multipart.File) (string, error)

UploadFile uploads a file to the storage provider.

ctx: the context for the operation. bucket: the storage bucket to upload the file to. key: the key or identifier of the file to be uploaded. file: the file to be uploaded. Returns the location of the uploaded file and an error, if any.

Types

This section is empty.

Jump to

Keyboard shortcuts

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