Documentation ¶
Index ¶
- Constants
- type R2
- func (r *R2) Attributes(bucket, prefix string) *system.Attrs
- func (r *R2) BatchAttributes(bucket, prefix string, recursive bool) []*system.Attrs
- func (r *R2) Cat(bucket, prefix string) []byte
- func (r *R2) Copy(srcBucket, srcPrefix, dstBucket, dstPrefix string)
- func (r *R2) Delete(bucket, prefix string)
- func (r *R2) DiskUsage(bucket, prefix string, recursive bool) []system.DiskUsage
- func (r *R2) Download(bucket, prefix, dstFile string, forceChecksum bool, ctx system.RunContext)
- func (r *R2) IsDirectory(bucket, prefix string) bool
- func (r *R2) IsObject(bucket, prefix string) bool
- func (r *R2) List(bucket, prefix string, recursive bool) []*system.FileObject
- func (r *R2) Move(srcBucket, srcPrefix, dstBucket, dstPrefix string)
- func (r *R2) MustEqualCRC32C(flag bool, localPath, bucket, object string)
- func (r *R2) R2Attrs(bucket, prefix string) *R2Attributes
- func (g *R2) Scheme() string
- func (r *R2) Upload(srcFile, bucket, prefix string, ctx system.RunContext)
- type R2Attributes
- type R2Config
Constants ¶
const (
R2CredentialsEnv = "R2_CREDENTIALS"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type R2 ¶
type R2 struct {
// contains filtered or unexported fields
}
func (*R2) Attributes ¶
GetObjectAttributes gets the attributes of an object
func (*R2) BatchAttributes ¶
GetObjectsAttributes gets the attributes of all the objects under a prefix
func (*R2) Download ¶
func (r *R2) Download( bucket, prefix, dstFile string, forceChecksum bool, ctx system.RunContext, )
DownloadObjectWithWorkerPool downloads a specific byte range of an object to a file.
func (*R2) IsDirectory ¶
IsDirectory checks if is a directory case 1: gs://abc/def -> gs://abc/def/ : true case 2: gs://abc/de -> gs://abc/def/ : false case 3: gs://abc/def/ -> gs://abc/def/ : true case 4: gs://abc/def -> gs://abc/def : false
func (*R2) IsObject ¶
IsObject checks if is an object case 1: gs://abc/def -> gs://abc/def/ : false case 2: gs://abc/de -> gs://abc/def/ : false case 3: gs://abc/def/ -> gs://abc/def/ : false case 4: gs://abc/def -> gs://abc/def : true
func (*R2) List ¶
func (r *R2) List(bucket, prefix string, recursive bool) []*system.FileObject
List objects under a prefix
func (*R2) MustEqualCRC32C ¶
MustEqualCRC32C compare CRC32C values if flag is set - compare a local file with an object from gcp - exit process if values are different
func (*R2) R2Attrs ¶
func (r *R2) R2Attrs(bucket, prefix string) *R2Attributes
type R2Attributes ¶
type R2Attributes struct { S3Attrs *s3.GetObjectAttributesOutput Bucket string Prefix string }