cloudflare

package
v0.0.0-...-5888283 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 9 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 {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cloudflareAccountID string, cloudflareAccessKeyID string, cloudflareAccessKeySecret string) Client

func (Client) CreateBucket

func (c Client) CreateBucket(ctx context.Context, bucket string) error

CreateBucket creates a bucket named bucket in R2

func (Client) GetObject

func (c Client) GetObject(ctx context.Context, bucket, objectKey string) ([]byte, error)

PutObject gets an object with key objectKey from the R2 bucket and returns it

func (Client) PutObject

func (c Client) PutObject(ctx context.Context, bucket, objectKey string, contentType string, objReader io.Reader) error

PutObject creates an object with key objectKey in the R2 bucket

Jump to

Keyboard shortcuts

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