Skip to content
/ go-r2 Public

R2 is Cloudflare storage service that same and compatible with AWS S3. This repository provide configuration and API usage.

Notifications You must be signed in to change notification settings

rneko26/go-r2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare R2

Cloudflare is storage service that compatible with AWS S3. You can use AWS SDK to interact with this service.

Get Started

Before started, you need following package to be imported in your project:

import (
    "github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/credentials"
	"github.com/aws/aws-sdk-go-v2/service/s3"
)

After that, you can run below command to install its package and dependencies.

go mod tidy

Configuration

Go to Cloudflare to grab your token. And then declare configuration using struct object below:

type R2Config struct {
    Bucket string 
    AccountID string 
    Key string 
    Secret string
}

About

R2 is Cloudflare storage service that same and compatible with AWS S3. This repository provide configuration and API usage.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages