r2

package
v0.0.0-...-317ab5b Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(r2config R2Config) (store.Store, error)

Types

type R2

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

func (*R2) Copy

func (r *R2) Copy(srcKey string, destKey string) error

Copy implements store.Store.

func (*R2) Delete

func (r *R2) Delete(key string) error

Delete implements store.Store.

func (*R2) Exists

func (r *R2) Exists(key string) (bool, error)

func (*R2) Get

func (r2 *R2) Get(key string) (io.ReadCloser, error)

func (*R2) Put

func (r2 *R2) Put(key string, r io.Reader, dataLength int64) error

Put implements store.Store.

func (*R2) PutFile

func (r *R2) PutFile(key string, localFile string) error

PutFile implements store.Store.

func (*R2) Rename

func (r *R2) Rename(srcKey string, destKey string) error

Rename implements store.Store.

func (*R2) Size

func (r *R2) Size(key string) (int64, error)

Size implements store.Store.

func (*R2) Url

func (r *R2) Url(key string) string

Url implements store.Store.

type R2Config

type R2Config struct {
	AccountId string `mapstructure:"account_id" json:"account_id" yaml:"account_id"`
	AccessKey string `mapstructure:"access_key" json:"access_key" yaml:"access_key"`
	SecretKey string `mapstructure:"secret_key" json:"secret_key" yaml:"secret_key"`
	Bucket    string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
}

Jump to

Keyboard shortcuts

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