r2ools

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: Unlicense Imports: 7 Imported by: 0

README

r2ools      Latest Release Go ReportCard

r2ools

What is this?

A wrapper for the official aws cli tool, with cloudflare r2 in mind

This tool was designed for use by myself only. Support may not be provided for any issues faced.

Err handling by Sentry

Made with 😖 , 😓 & 🤮

Installation

Dependencies
  • aws cli tool
Via Go

go get github.com/joshhhhyyyy/r2ools

go install github.com/joshhhhyyyy/r2ools

export PATH=$PATH:$(go env GOPATH)/bin (Add gopath to path)

Via apt

echo "deb [trusted=yes] https://apt.joseos.com/ ./" | sudo tee /etc/apt/sources.list.d/joseos.list

sudo apt update

sudo apt install r2ools

Usage

Prerequisites
  • Either:
    • An environment variable named endpoint that contains your s3 api endpoint url, OR
    • An environment variable named r2id that contains your cloudflare user id
  • An existing bucket in cloudflare r2 (this tool does not allow you to create or delete buckets)
Available Subcommands

r2 ls or list <bucket-name>: lists all files in the bucket, lists all buckets if no name is supplied

r2 put <bucket> <path to file>: uploads file

r2 get <bucket> <file to get> <output path>: downloads file

r2 sign <bucket> <file> <expiresin>: generate presigned url for file. Expiresin default: 3600s (1h)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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