filesync

package
v0.19.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tracer added in v0.19.3

func Tracer(ctx context.Context) trace.Tracer

Types

type CacheRefMetadata added in v0.19.3

type CacheRefMetadata struct {
	bkcache.RefMetadata
}

type CachedChange added in v0.19.3

type CachedChange = cache.Result[string, *ChangeWithStat]

type ChangeFunc added in v0.19.3

type ChangeFunc func(kind ChangeKind, path string, lowerStat, upperStat *types.Stat) error

type ChangeKind added in v0.19.3

type ChangeKind = fsutil.ChangeKind
const (
	ChangeKindAdd    ChangeKind = fsutil.ChangeKindAdd
	ChangeKindModify ChangeKind = fsutil.ChangeKindModify
	ChangeKindDelete ChangeKind = fsutil.ChangeKindDelete
	ChangeKindNone   ChangeKind = fsutil.ChangeKindDelete + 1
)

type ChangeWithStat added in v0.19.3

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

type ErrConflict added in v0.19.3

type ErrConflict struct {
	Path      string
	FieldName string
	OldVal    string
	NewVal    string
}

func (*ErrConflict) Error added in v0.19.3

func (e *ErrConflict) Error() string

type FileSyncer added in v0.19.3

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

func NewFileSyncer added in v0.19.3

func NewFileSyncer(opt FileSyncerOpt) *FileSyncer

func (*FileSyncer) Snapshot added in v0.19.3

func (ls *FileSyncer) Snapshot(ctx context.Context, session session.Group, sm *session.Manager, clientPath string, opts SnapshotOpts) (bkcache.ImmutableRef, error)

type FileSyncerOpt added in v0.19.3

type FileSyncerOpt struct {
	CacheAccessor bkcache.Accessor
}

type HashedStatInfo added in v0.19.3

type HashedStatInfo struct {
	StatInfo
	// contains filtered or unexported fields
}

func (*HashedStatInfo) Digest added in v0.19.3

func (s *HashedStatInfo) Digest() digest.Digest

type ReadFS added in v0.19.3

type ReadFS interface {
	WalkFS
	ReadFile(ctx context.Context, path string) (io.ReadCloser, error)
}

type SnapshotOpts added in v0.19.3

type SnapshotOpts struct {
	IncludePatterns []string
	ExcludePatterns []string
	GitIgnore       bool
	CacheBuster     string

	// If set, the snapshot will be relative that path.
	// This is required when `GitIgnore` is set so we don't returns
	// the whole git repo but simply apply .gitignore rules on that path.
	RelativePath string
}

type StatInfo added in v0.19.3

type StatInfo struct {
	*types.Stat
}

func (*StatInfo) Info added in v0.19.3

func (s *StatInfo) Info() (fs.FileInfo, error)

func (*StatInfo) IsDir added in v0.19.3

func (s *StatInfo) IsDir() bool

func (*StatInfo) ModTime added in v0.19.3

func (s *StatInfo) ModTime() time.Time

func (*StatInfo) Mode added in v0.19.3

func (s *StatInfo) Mode() os.FileMode

func (*StatInfo) Name added in v0.19.3

func (s *StatInfo) Name() string

func (*StatInfo) Size added in v0.19.3

func (s *StatInfo) Size() int64

func (*StatInfo) Sys added in v0.19.3

func (s *StatInfo) Sys() any

func (*StatInfo) Type added in v0.19.3

func (s *StatInfo) Type() fs.FileMode

type WalkFS added in v0.19.3

type WalkFS interface {
	Walk(ctx context.Context, path string, walkFn fs.WalkDirFunc) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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