rclone

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CChorusSourceVersionIDMetaHeader = "x-amz-meta-chorus-source-version-id"
	CRGWVersionMigrationMetaHeader   = "x-amz-meta-rgwx-version-id"
)
View Source
const MB = 1000000

Variables

This section is empty.

Functions

func WithAfter added in v0.6.0

func WithAfter(after string) func(o *minio.ListObjectsOptions)

func WithPrefix added in v0.6.0

func WithPrefix(prefix string) func(o *minio.ListObjectsOptions)

func WithVersions added in v0.6.0

func WithVersions() func(o *minio.ListObjectsOptions)

Types

type Bucket added in v0.6.0

type Bucket struct {
	Storage string
	Bucket  string
}

func NewBucket added in v0.6.0

func NewBucket(storage string, bucket string) Bucket

type CompareRes

type CompareRes struct {
	SrcStor  string
	DestStor string
	Bucket   string

	MissFrom []string
	MissTo   []string
	Differ   []string
	Error    []string
	Match    []string
	IsMatch  bool
}

type Config

type Config struct {
	MemoryCalc      MemoryCalc                `yaml:"memoryCalc"`
	MemoryLimit     MemoryLimit               `yaml:"memoryLimit"`
	LocalFileLimit  ratelimit.SemaphoreConfig `yaml:"localFileLimit"`
	GlobalFileLimit ratelimit.SemaphoreConfig `yaml:"globalFileLimit"`
}

type CopySvc added in v0.6.0

type CopySvc interface {
	BucketObjects(ctx context.Context, user string, bucket Bucket, opts ...func(o *minio.ListObjectsOptions)) iter.Seq2[ObjectInfo, error]
	IsBucketVersioned(ctx context.Context, user string, bucket Bucket) (bool, error)
	GetVersionInfo(ctx context.Context, user string, to File) ([]ObjectVersionInfo, error)
	DeleteDestinationObject(ctx context.Context, user string, to File) error
	GetLastMigratedVersionInfo(ctx context.Context, user string, to File) (ObjectVersionInfo, error)
	CopyObject(ctx context.Context, user string, from File, to File) error
}

type File

type File struct {
	Storage string
	Bucket  string
	Name    string
	Version string
}

func NewFile added in v0.6.0

func NewFile(storage string, bucket string, name string) File

func NewVersionedFile added in v0.6.0

func NewVersionedFile(storage string, bucket string, name string, version string) File

type LimiterSvc added in v0.6.0

type LimiterSvc interface {
	Reserve(ctx context.Context, size int64) (func(), error)
}

type MemCalculator

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

func NewMemoryCalculator

func NewMemoryCalculator(conf MemoryCalc) *MemCalculator

type MemoryCalc

type MemoryCalc struct {
	Const string  `yaml:"const"`
	Mul   float64 `yaml:"mul"`
}

type MemoryLimit

type MemoryLimit struct {
	Limit    string        `yaml:"limit"`
	RetryMin time.Duration `yaml:"retryMin"`
	RetryMax time.Duration `yaml:"retryMax"`
	Enabled  bool          `yaml:"enabled"`
}

type MemoryLimiterSvc added in v0.6.0

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

func NewMemoryLimiterSvc added in v0.6.0

func NewMemoryLimiterSvc(memCalc *MemCalculator, memLimiter ratelimit.Semaphore, fileLimiter ratelimit.Semaphore, metricsSvc metrics.S3Service) *MemoryLimiterSvc

func (*MemoryLimiterSvc) Reserve added in v0.6.0

func (r *MemoryLimiterSvc) Reserve(ctx context.Context, fileSize int64) (func(), error)

type ObjectInfo added in v0.6.0

type ObjectInfo struct {
	LastModified time.Time
	Key          string
	VersionID    string
	Etag         string
	StorageClass string
	Size         uint64
}

type ObjectVersionInfo added in v0.6.0

type ObjectVersionInfo struct {
	Version string
	Size    uint64
}

type S3CopySvc added in v0.6.0

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

func NewS3CopySvc added in v0.6.0

func NewS3CopySvc(clientRegistry s3client.Service, memoryLimiterSvc LimiterSvc, requestLimiterSvc ratelimit.RPM, metricsSvc metrics.S3Service) *S3CopySvc

func (*S3CopySvc) AddMetrics added in v0.6.0

func (r *S3CopySvc) AddMetrics(ctx context.Context, from File, to File, size int64)

func (*S3CopySvc) BucketObjects added in v0.6.0

func (r *S3CopySvc) BucketObjects(ctx context.Context, user string, bucket Bucket, opts ...func(o *minio.ListObjectsOptions)) iter.Seq2[ObjectInfo, error]

func (*S3CopySvc) CopyACLs added in v0.6.0

func (r *S3CopySvc) CopyACLs(ctx context.Context, user string, from File, to File) error

func (*S3CopySvc) CopyObject added in v0.6.0

func (r *S3CopySvc) CopyObject(ctx context.Context, user string, from File, to File) error

func (*S3CopySvc) DeleteDestinationObject added in v0.6.0

func (r *S3CopySvc) DeleteDestinationObject(ctx context.Context, user string, to File) error

func (*S3CopySvc) GetLastMigratedVersionInfo added in v0.6.0

func (r *S3CopySvc) GetLastMigratedVersionInfo(ctx context.Context, user string, to File) (ObjectVersionInfo, error)

func (*S3CopySvc) GetVersionInfo added in v0.6.0

func (r *S3CopySvc) GetVersionInfo(ctx context.Context, user string, to File) ([]ObjectVersionInfo, error)

func (*S3CopySvc) IsBucketVersioned added in v0.6.0

func (r *S3CopySvc) IsBucketVersioned(ctx context.Context, user string, bucket Bucket) (bool, error)

type Service

type Service interface {
	CopyTo(ctx context.Context, user string, from, to File, size int64) error

	Compare(ctx context.Context, listMatch bool, user, from, to, fromBucket string, toBucket string) (*CompareRes, error)
}

func New

func New(conf *s3.StorageConfig, jsonLog bool, metricsSvc metrics.S3Service, mamCalc *MemCalculator, memLimiter, fileLimiter ratelimit.Semaphore) (Service, error)

Jump to

Keyboard shortcuts

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