cloudflare

package
v0.0.0-...-7253f33 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type R2Client

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

R2Client wraps the AWS S3 client for Cloudflare R2 operations

var R2 *R2Client

Global R2Client instance

func NewR2Client

func NewR2Client(endpoint, accessKeyID, secretKey, bucketName string) (*R2Client, error)

NewR2Client creates a new R2Client with the specified configuration

func (*R2Client) DeleteObject

func (c *R2Client) DeleteObject(ctx context.Context, key string) error

DeleteObject deletes an object from the R2 bucket

func (*R2Client) GetObjectMetadata

func (c *R2Client) GetObjectMetadata(ctx context.Context, key string) (*s3.HeadObjectOutput, error)

GetObjectMetadata retrieves the metadata of an object from the R2 bucket

func (*R2Client) ListObjects

func (c *R2Client) ListObjects(ctx context.Context) (*s3.ListObjectsV2Output, error)

ListObjects lists objects in the R2 bucket

func (*R2Client) UploadFile

func (c *R2Client) UploadFile(ctx context.Context, file io.Reader, key string) error

UploadFile uploads a file to the R2 bucket UploadFile uploads a file to the R2 bucket

Jump to

Keyboard shortcuts

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