sync

package
v1.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 33 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyData added in v0.1.3

func CopyData(src, dst object.ObjectStorage, key string, size int64, calChksum bool) (uint32, error)

func InitForCopyData added in v0.1.3

func InitForCopyData()

func ListAll

func ListAll(store object.ObjectStorage, prefix, start, end string, followLink bool) (<-chan object.Object, error)

ListAll on all the keys that starts at marker from object storage.

func Sync

func Sync(src, dst object.ObjectStorage, config *Config) error

Sync syncs all the keys between to object storage

Types

type Config

type Config struct {
	StorageClass   string
	Start          string
	End            string
	Threads        int
	Update         bool
	ForceUpdate    bool
	Perms          bool
	MaxFailure     int64
	Dry            bool
	DeleteSrc      bool
	DeleteDst      bool
	MatchFullPath  bool
	Dirs           bool
	Exclude        []string
	Include        []string
	Existing       bool
	IgnoreExisting bool
	Links          bool
	Inplace        bool
	Limit          int64
	Manager        string
	Workers        []string
	ManagerAddr    string
	ListThreads    int
	ListDepth      int
	BWLimit        int64
	NoHTTPS        bool
	Verbose        bool
	Quiet          bool
	CheckAll       bool
	CheckNew       bool
	CheckChange    bool
	MaxSize        int64
	MinSize        int64
	MaxAge         time.Duration
	MinAge         time.Duration
	StartTime      time.Time
	EndTime        time.Time
	Env            map[string]string

	FilesFrom string

	Registerer prometheus.Registerer
	// contains filtered or unexported fields
}

func NewConfigFromCli

func NewConfigFromCli(c *cli.Context) *Config

type Stat

type Stat struct {
	Copied       int64    // the number of copied files
	CopiedBytes  int64    // total amount of copied data in bytes
	Checked      int64    // the number of checked files
	CheckedBytes int64    // total amount of checked data in bytes
	Deleted      int64    // the number of deleted files
	Skipped      int64    // the number of files skipped
	SkippedBytes int64    // total amount of skipped data in bytes
	Failed       int64    // the number of files that fail to copy
	DelayDelDir  []string // the directories that need to be deleted
}

Stat has the counters to represent the progress.

Jump to

Keyboard shortcuts

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