sync

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEncryptionKey added in v0.1.10

func GetEncryptionKey() ([]byte, error)

Types

type GlobalConfig

type GlobalConfig struct {
	// Specifies which files should be synced for machines associated with each tag. The key in this map is the tag
	// name. The value is the list of files/directories that should be synced for that tag.
	TagPaths map[string][]string `yaml:"paths"`
}

type HandleFileOutcome added in v0.1.18

type HandleFileOutcome int
const (
	DownloadedFile HandleFileOutcome = iota
	UploadedFile
	MarkedDeleted
	NoChange
)

type LocalConfig

type LocalConfig struct {
	// Specifies with tags this machine should be associated with.
	Tags []string `yaml:"tags"`
}

type LocalFileStateData added in v0.1.9

type LocalFileStateData struct {
	// The last time this file has been uploaded/downloaded from the cloud.
	LastCloudUpdate time.Time
	// Whether this file has been deleted locally.
	DeletedLocal bool
}

type LocalStateData added in v0.1.9

type LocalStateData struct {
	// Key is file path. Value is the state data associated with that file.
	FileStateData map[string]*LocalFileStateData
}

type RemoteFileStateData added in v0.1.9

type RemoteFileStateData struct {
	// The datetime this file was marked as deleted.
	MarkDeleted time.Time
}

type RemoteStateData added in v0.1.9

type RemoteStateData struct {
	// Key is file path. Value is the state data associated with that file.
	FileStateData map[string]*RemoteFileStateData
}

type SyncedFile added in v0.1.9

type SyncedFile struct {
	FriendlyPath string
	RealPath     string
	IsRemoteDir  bool
}

type Syncer

type Syncer struct {
	RemoteFileStore filestore.FileStore
	LocalFileStore  filestore.FileStore
	Logger          utils.Logger
	// Used to encrypt files stored in the remote file store.
	Encryptor utils.ReaderEncryptor
	// ForceDownload will download a file even if the local modified time is after the remote modified time.
	ForceDownload bool
	// contains filtered or unexported fields
}

func (*Syncer) PerformSync

func (s *Syncer) PerformSync() error

PerformSync does the entire sync from end to end.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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