local

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndexFileName = ".lakefs_ref.yaml"
	IgnoreMarker  = "ignored by lakectl local"
	IndexFileMode = 0o644
)
View Source
const (
	DefaultDirectoryMask   = 0o755
	ClientMtimeMetadataKey = apiutil.LakeFSMetadataPrefix + "client-mtime"
)

Variables

View Source
var (
	ErrConflict        = errors.New("conflict")
	ErrDownloadingFile = errors.New("error downloading file")
	ErrRemoteFailure   = errors.New("remote failure")
)

Functions

func ChangeSourceString added in v0.106.0

func ChangeSourceString(changeSource ChangeSource) string

func ChangeTypeString added in v0.106.0

func ChangeTypeString(changeType ChangeType) string

func FindIndices

func FindIndices(root string) ([]string, error)

FindIndices searches the specified root directory for index files, returning their relative directory paths while skipping hidden folders.

func IndexExists

func IndexExists(baseAbs string) (bool, error)

func ListRemote added in v0.106.0

func ListRemote(ctx context.Context, client apigen.ClientWithResponsesInterface, loc *uri.URI, objects chan<- apigen.ObjectStats) error

ListRemote - Lists objects from a remote uri and inserts them into the objects channel

Types

type Change added in v0.106.0

type Change struct {
	Source ChangeSource
	Path   string
	Type   ChangeType
}

func (*Change) String added in v0.106.0

func (c *Change) String() string

type ChangeSource added in v0.106.0

type ChangeSource int
const (
	ChangeSourceRemote ChangeSource = iota
	ChangeSourceLocal
)

type ChangeType added in v0.106.0

type ChangeType int
const (
	ChangeTypeAdded ChangeType = iota
	ChangeTypeModified
	ChangeTypeRemoved
	ChangeTypeConflict
)

func ChangeTypeFromString added in v0.106.0

func ChangeTypeFromString(changeType string) ChangeType

type Changes added in v0.106.0

type Changes []*Change

func DiffLocalWithHead added in v0.106.0

func DiffLocalWithHead(left <-chan apigen.ObjectStats, rightPath string) (Changes, error)

DiffLocalWithHead Checks changes between a local directory and the head it is pointing to. The diff check assumes the remote is an immutable set so any changes found resulted from changes in the local directory left is an object channel which contains results from a remote source. rightPath is the local directory to diff with

func Undo added in v0.106.0

func Undo(c Changes) Changes

Undo Creates a new list of changes that reverses the given changes list.

func (Changes) MergeWith added in v0.106.0

func (c Changes) MergeWith(other Changes, strategy MergeStrategy) Changes

MergeWith combines changes from two diffs, sorting by lexicographic order. If the same path appears in both diffs, it's marked as a conflict.

func (Changes) String added in v0.106.0

func (c Changes) String() string

type Index

type Index struct {
	PathURI         string `yaml:"src"`
	AtHead          string `yaml:"at_head"`
	ActiveOperation string `yaml:"active_operation"`
	// contains filtered or unexported fields
}

Index defines the structure of the lakefs local reference file consisting of the information linking local directory with lakefs path

func ReadIndex

func ReadIndex(path string) (*Index, error)

func WriteIndex

func WriteIndex(path string, remote *uri.URI, atHead string, operation string) (*Index, error)

func (*Index) GetCurrentURI

func (l *Index) GetCurrentURI() (*uri.URI, error)

func (*Index) LocalPath

func (l *Index) LocalPath() string

type MergeStrategy added in v0.106.0

type MergeStrategy int
const (
	MergeStrategyNone MergeStrategy = iota
	MergeStrategyThis
	MergeStrategyOther
)

type ProgressPool added in v0.106.0

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

func NewProgressPool added in v0.106.0

func NewProgressPool() *ProgressPool

func (*ProgressPool) AddReader added in v0.106.0

func (p *ProgressPool) AddReader(name string, sizeBytes int64) *ProgressUpdater

func (*ProgressPool) AddSpinner added in v0.106.0

func (p *ProgressPool) AddSpinner(name string) *ProgressSpinner

func (*ProgressPool) Start added in v0.106.0

func (p *ProgressPool) Start()

func (*ProgressPool) Stop added in v0.106.0

func (p *ProgressPool) Stop()

type ProgressSpinner added in v0.106.0

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

func (*ProgressSpinner) Done added in v0.106.0

func (p *ProgressSpinner) Done()

func (*ProgressSpinner) Error added in v0.106.0

func (p *ProgressSpinner) Error()

type ProgressUpdater added in v0.106.0

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

func (*ProgressUpdater) Done added in v0.106.0

func (p *ProgressUpdater) Done()

func (*ProgressUpdater) Error added in v0.106.0

func (p *ProgressUpdater) Error()

func (*ProgressUpdater) Reader added in v0.106.0

func (p *ProgressUpdater) Reader(reader io.Reader) io.Reader

type ProgressUpdaterReader added in v0.106.0

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

func (*ProgressUpdaterReader) Read added in v0.106.0

func (pu *ProgressUpdaterReader) Read(p []byte) (n int, err error)

type SyncFlags added in v0.113.0

type SyncFlags struct {
	Parallelism      int
	Presign          bool
	PresignMultipart bool
}

type SyncManager added in v0.106.0

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

func NewSyncManager added in v0.106.0

func NewSyncManager(ctx context.Context, client *apigen.ClientWithResponses, flags SyncFlags) *SyncManager

func (*SyncManager) Summary added in v0.106.0

func (s *SyncManager) Summary() Tasks

func (*SyncManager) Sync added in v0.106.0

func (s *SyncManager) Sync(rootPath string, remote *uri.URI, changeSet <-chan *Change) error

Sync - sync changes between remote and local directory given the Changes channel. For each change, will apply download, upload or delete according to the change type and change source

type Tasks added in v0.106.0

type Tasks struct {
	Downloaded uint64
	Uploaded   uint64
	Removed    uint64
}

Jump to

Keyboard shortcuts

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