Documentation
¶
Overview ¶
Package sync provides the core data structures and algorithms used by Mutagen. It does not provide facilities for data transport or session management, which are instead provided by the rsync and session packages, respectively.
Index ¶
- Variables
- func EnsureDefaultDirectoryModeValid(mode fs.Mode) error
- func EnsureDefaultFileModeValid(mode fs.Mode) error
- func PathBase(path string) string
- func Reconcile(ancestor, alpha, beta *Entry, synchronizationMode SynchronizationMode) ([]*Change, []*Change, []*Change, []*Conflict)
- func Scan(root string, baseline *Entry, recheckPaths map[string]bool, hasher hash.Hash, ...) (*Entry, bool, bool, *Cache, IgnoreCache, error)
- func Transition(root string, transitions []*Change, cache *Cache, symlinkMode SymlinkMode, ...) ([]*Entry, []*Problem, bool)
- func TransitionDependencies(transitions []*Change) ([]string, [][]byte, error)
- func ValidIgnorePattern(pattern string) bool
- type Archive
- func (*Archive) Descriptor() ([]byte, []int)
- func (a *Archive) EnsureValid() error
- func (m *Archive) GetRoot() *Entry
- func (*Archive) ProtoMessage()
- func (m *Archive) Reset()
- func (m *Archive) String() string
- func (m *Archive) XXX_DiscardUnknown()
- func (m *Archive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Archive) XXX_Merge(src proto.Message)
- func (m *Archive) XXX_Size() int
- func (m *Archive) XXX_Unmarshal(b []byte) error
- type Cache
- func (*Cache) Descriptor() ([]byte, []int)
- func (c *Cache) EnsureValid() error
- func (c *Cache) Equal(other *Cache) bool
- func (c *Cache) GenerateReverseLookupMap() (*ReverseLookupMap, error)
- func (m *Cache) GetEntries() map[string]*CacheEntry
- func (*Cache) ProtoMessage()
- func (m *Cache) Reset()
- func (m *Cache) String() string
- func (m *Cache) XXX_DiscardUnknown()
- func (m *Cache) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Cache) XXX_Merge(src proto.Message)
- func (m *Cache) XXX_Size() int
- func (m *Cache) XXX_Unmarshal(b []byte) error
- type CacheEntry
- func (*CacheEntry) Descriptor() ([]byte, []int)
- func (m *CacheEntry) GetDigest() []byte
- func (m *CacheEntry) GetFileID() uint64
- func (m *CacheEntry) GetMode() uint32
- func (m *CacheEntry) GetModificationTime() *timestamp.Timestamp
- func (m *CacheEntry) GetSize() uint64
- func (*CacheEntry) ProtoMessage()
- func (m *CacheEntry) Reset()
- func (m *CacheEntry) String() string
- func (m *CacheEntry) XXX_DiscardUnknown()
- func (m *CacheEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CacheEntry) XXX_Merge(src proto.Message)
- func (m *CacheEntry) XXX_Size() int
- func (m *CacheEntry) XXX_Unmarshal(b []byte) error
- type Change
- func (*Change) Descriptor() ([]byte, []int)
- func (c *Change) EnsureValid() error
- func (m *Change) GetNew() *Entry
- func (m *Change) GetOld() *Entry
- func (m *Change) GetPath() string
- func (*Change) ProtoMessage()
- func (m *Change) Reset()
- func (m *Change) String() string
- func (m *Change) XXX_DiscardUnknown()
- func (m *Change) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Change) XXX_Merge(src proto.Message)
- func (m *Change) XXX_Size() int
- func (m *Change) XXX_Unmarshal(b []byte) error
- type Conflict
- func (c *Conflict) CopySlim() *Conflict
- func (*Conflict) Descriptor() ([]byte, []int)
- func (c *Conflict) EnsureValid() error
- func (m *Conflict) GetAlphaChanges() []*Change
- func (m *Conflict) GetBetaChanges() []*Change
- func (*Conflict) ProtoMessage()
- func (m *Conflict) Reset()
- func (c *Conflict) Root() string
- func (m *Conflict) String() string
- func (m *Conflict) XXX_DiscardUnknown()
- func (m *Conflict) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Conflict) XXX_Merge(src proto.Message)
- func (m *Conflict) XXX_Size() int
- func (m *Conflict) XXX_Unmarshal(b []byte) error
- type Entry
- func (e *Entry) Copy() *Entry
- func (e *Entry) Count() uint64
- func (*Entry) Descriptor() ([]byte, []int)
- func (e *Entry) EnsureValid() error
- func (e *Entry) Equal(other *Entry) bool
- func (m *Entry) GetContents() map[string]*Entry
- func (m *Entry) GetDigest() []byte
- func (m *Entry) GetExecutable() bool
- func (m *Entry) GetKind() EntryKind
- func (m *Entry) GetTarget() string
- func (*Entry) ProtoMessage()
- func (m *Entry) Reset()
- func (m *Entry) String() string
- func (m *Entry) XXX_DiscardUnknown()
- func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Entry) XXX_Merge(src proto.Message)
- func (m *Entry) XXX_Size() int
- func (m *Entry) XXX_Unmarshal(b []byte) error
- type EntryKind
- type IgnoreCache
- type IgnoreCacheKey
- type IgnoreVCSMode
- type Problem
- func (*Problem) Descriptor() ([]byte, []int)
- func (p *Problem) EnsureValid() error
- func (m *Problem) GetError() string
- func (m *Problem) GetPath() string
- func (*Problem) ProtoMessage()
- func (m *Problem) Reset()
- func (m *Problem) String() string
- func (m *Problem) XXX_DiscardUnknown()
- func (m *Problem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Problem) XXX_Merge(src proto.Message)
- func (m *Problem) XXX_Size() int
- func (m *Problem) XXX_Unmarshal(b []byte) error
- type Provider
- type ReverseLookupMap
- type SymlinkMode
- type SynchronizationMode
- func (m SynchronizationMode) Description() string
- func (SynchronizationMode) EnumDescriptor() ([]byte, []int)
- func (m SynchronizationMode) IsDefault() bool
- func (x SynchronizationMode) String() string
- func (m SynchronizationMode) Supported() bool
- func (m *SynchronizationMode) UnmarshalText(textBytes []byte) error
Constants ¶
This section is empty.
Variables ¶
var DefaultVCSIgnores = []string{
".git/",
".svn/",
".hg/",
".bzr/",
"_darcs/",
}
DefaultVCSIgnores is the default set of ignores to use when ignoring VCS directories.
var EntryKind_name = map[int32]string{
0: "Directory",
1: "File",
2: "Symlink",
}
var EntryKind_value = map[string]int32{
"Directory": 0,
"File": 1,
"Symlink": 2,
}
var IgnoreVCSMode_name = map[int32]string{
0: "IgnoreVCSModeDefault",
1: "IgnoreVCSModeIgnore",
2: "IgnoreVCSModePropagate",
}
var IgnoreVCSMode_value = map[string]int32{
"IgnoreVCSModeDefault": 0,
"IgnoreVCSModeIgnore": 1,
"IgnoreVCSModePropagate": 2,
}
var SymlinkMode_name = map[int32]string{
0: "SymlinkModeDefault",
1: "SymlinkModeIgnore",
2: "SymlinkModePortable",
3: "SymlinkModePOSIXRaw",
}
var SymlinkMode_value = map[string]int32{
"SymlinkModeDefault": 0,
"SymlinkModeIgnore": 1,
"SymlinkModePortable": 2,
"SymlinkModePOSIXRaw": 3,
}
var SynchronizationMode_name = map[int32]string{
0: "SynchronizationModeDefault",
1: "SynchronizationModeTwoWaySafe",
2: "SynchronizationModeTwoWayResolved",
3: "SynchronizationModeOneWaySafe",
4: "SynchronizationModeOneWayReplica",
}
var SynchronizationMode_value = map[string]int32{
"SynchronizationModeDefault": 0,
"SynchronizationModeTwoWaySafe": 1,
"SynchronizationModeTwoWayResolved": 2,
"SynchronizationModeOneWaySafe": 3,
"SynchronizationModeOneWayReplica": 4,
}
Functions ¶
func EnsureDefaultDirectoryModeValid ¶ added in v0.8.0
EnsureDefaultDirectoryModeValid validates that a user-provided default directory mode is valid in the context of Mutagen's synchronization algorithms.
func EnsureDefaultFileModeValid ¶ added in v0.8.0
EnsureDefaultFileModeValid validates that a user-provided default file mode is valid in the context of "portable" permission propagation. In particular, it enforces that the mode is non-0 and that no executable bits are set (since these should be regulated by the synchronization algorithm).
func PathBase ¶ added in v0.9.0
PathBase is a fast alternative to path.Base designed specifically for root-relative synchronization paths. If the provided path is empty (i.e. the root path), this function returns an empty string. If the provided path contains no slashes, then it is returned directly. If the path ends with a slash, this function panics, because that represents an invalid root-relative path.
func Reconcile ¶
func Reconcile( ancestor, alpha, beta *Entry, synchronizationMode SynchronizationMode, ) ([]*Change, []*Change, []*Change, []*Conflict)
Reconcile performs a recursive three-way merge and generates a list of changes for the ancestor, alpha, and beta, as well as a list of conflicts.
func Scan ¶
func Scan( root string, baseline *Entry, recheckPaths map[string]bool, hasher hash.Hash, cache *Cache, ignores []string, ignoreCache IgnoreCache, probeMode behavior.ProbeMode, symlinkMode SymlinkMode, ) (*Entry, bool, bool, *Cache, IgnoreCache, error)
Scan provides recursive filesystem scanning facilities for synchronization roots.
func Transition ¶
func Transition( root string, transitions []*Change, cache *Cache, symlinkMode SymlinkMode, defaultFilePermissionMode filesystem.Mode, defaultDirectoryPermissionMode filesystem.Mode, defaultOwnership *filesystem.OwnershipSpecification, recomposeUnicode bool, provider Provider, ) ([]*Entry, []*Problem, bool)
Transition provides recursive filesystem transitioning facilities for synchronization roots, allowing the application of changes after reconciliation. The path to the provided synchronization root must be absolute and normalized (using filepath.Clean). The function returns a slice of the resulting entries, problems, and a boolean indicating whether or not the provider was missing files.
func TransitionDependencies ¶
TransitionDependencies analyzes a list of transitions and determines the file paths (and their corresponding digests) that will need to be provided in order to apply the transitions using Transition. It will return these paths in depth-first traversal order.
func ValidIgnorePattern ¶
ValidIgnorePattern checks whether or not a given pattern is a valid ignore specification.
Types ¶
type Archive ¶
type Archive struct { Root *Entry `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Archive is a wrapper around Entry that allows identification of non-existent roots when serializing. In-memory, a nil-Entry (that arrives without any error) represents an absence of content on the filesystem. Unfortunately, there is no way to represent that as an encoded message (an empty byte slice would successfully decode to an empty directory entry). By adding a level of indirection that allows for an unset root entry, we can encode Entry messages in a way that allows us to represent absence.
func (*Archive) Descriptor ¶
func (*Archive) EnsureValid ¶ added in v0.7.0
func (*Archive) ProtoMessage ¶
func (*Archive) ProtoMessage()
func (*Archive) XXX_DiscardUnknown ¶
func (m *Archive) XXX_DiscardUnknown()
func (*Archive) XXX_Marshal ¶
func (*Archive) XXX_Unmarshal ¶
type Cache ¶
type Cache struct { // Entries is a map from scan path to cache entry. Entries map[string]*CacheEntry `` /* 155-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Cache provides a store for file metadata and digets to allow for efficient rescans.
func (*Cache) Descriptor ¶
func (*Cache) EnsureValid ¶
EnsureValid ensures that Cache's invariants are respected.
func (*Cache) Equal ¶ added in v0.9.0
Equal determines whether or not another cache is equal to this one. It is designed specifically for tests, though it is exported so that it can be used by scan_bench.
func (*Cache) GenerateReverseLookupMap ¶ added in v0.5.0
func (c *Cache) GenerateReverseLookupMap() (*ReverseLookupMap, error)
GenerateReverseLookupMap creates a reverse lookup map from a cache.
func (*Cache) GetEntries ¶
func (m *Cache) GetEntries() map[string]*CacheEntry
func (*Cache) ProtoMessage ¶
func (*Cache) ProtoMessage()
func (*Cache) XXX_DiscardUnknown ¶
func (m *Cache) XXX_DiscardUnknown()
func (*Cache) XXX_Marshal ¶
func (*Cache) XXX_Unmarshal ¶
type CacheEntry ¶
type CacheEntry struct { // Mode stores the value of the POSIX mode bits (i.e. the st_mode member of // struct stat). On Windows, this value is computed using the Go os.FileMode // value retrieved through the os package (for which bit definitions are // guaranteed to be stable). Mode uint32 `protobuf:"varint,1,opt,name=mode,proto3" json:"mode,omitempty"` // ModificationTime is the cached modification time. ModificationTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=modificationTime,proto3" json:"modificationTime,omitempty"` // Size is the cached size. Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` // FileID is the file identifier. On POSIX systems it is the inode number. // On Windows it is currently 0. FileID uint64 `protobuf:"varint,4,opt,name=fileID,proto3" json:"fileID,omitempty"` // Digest is the cached digest for file entries. Digest []byte `protobuf:"bytes,9,opt,name=digest,proto3" json:"digest,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
CacheEntry represents cache data for a file on disk.
func (*CacheEntry) Descriptor ¶
func (*CacheEntry) Descriptor() ([]byte, []int)
func (*CacheEntry) GetDigest ¶
func (m *CacheEntry) GetDigest() []byte
func (*CacheEntry) GetFileID ¶ added in v0.8.0
func (m *CacheEntry) GetFileID() uint64
func (*CacheEntry) GetMode ¶
func (m *CacheEntry) GetMode() uint32
func (*CacheEntry) GetModificationTime ¶
func (m *CacheEntry) GetModificationTime() *timestamp.Timestamp
func (*CacheEntry) GetSize ¶
func (m *CacheEntry) GetSize() uint64
func (*CacheEntry) ProtoMessage ¶
func (*CacheEntry) ProtoMessage()
func (*CacheEntry) Reset ¶
func (m *CacheEntry) Reset()
func (*CacheEntry) String ¶
func (m *CacheEntry) String() string
func (*CacheEntry) XXX_DiscardUnknown ¶
func (m *CacheEntry) XXX_DiscardUnknown()
func (*CacheEntry) XXX_Marshal ¶
func (m *CacheEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CacheEntry) XXX_Merge ¶
func (m *CacheEntry) XXX_Merge(src proto.Message)
func (*CacheEntry) XXX_Size ¶
func (m *CacheEntry) XXX_Size() int
func (*CacheEntry) XXX_Unmarshal ¶
func (m *CacheEntry) XXX_Unmarshal(b []byte) error
type Change ¶
type Change struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` Old *Entry `protobuf:"bytes,2,opt,name=old,proto3" json:"old,omitempty"` New *Entry `protobuf:"bytes,3,opt,name=new,proto3" json:"new,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func Diff ¶ added in v0.9.0
Diff performs a diff operation from the base to the target entry, generating a list of changes.
func (*Change) Descriptor ¶
func (*Change) EnsureValid ¶
EnsureValid ensures that Change's invariants are respected.
func (*Change) ProtoMessage ¶
func (*Change) ProtoMessage()
func (*Change) XXX_DiscardUnknown ¶
func (m *Change) XXX_DiscardUnknown()
func (*Change) XXX_Marshal ¶
func (*Change) XXX_Unmarshal ¶
type Conflict ¶
type Conflict struct { AlphaChanges []*Change `protobuf:"bytes,1,rep,name=alphaChanges,proto3" json:"alphaChanges,omitempty"` BetaChanges []*Change `protobuf:"bytes,2,rep,name=betaChanges,proto3" json:"betaChanges,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Conflict) CopySlim ¶ added in v0.8.0
CopySlim returns a copy of the conflict, except that each Change object has had its root entry reduced to a shallow copy (i.e. excluding any contents). The conflict will still have enough metadata to determine its root path, and it will be considered valid.
func (*Conflict) Descriptor ¶
func (*Conflict) EnsureValid ¶
EnsureValid ensures that Conflict's invariants are respected.
func (*Conflict) GetAlphaChanges ¶
func (*Conflict) GetBetaChanges ¶
func (*Conflict) ProtoMessage ¶
func (*Conflict) ProtoMessage()
func (*Conflict) XXX_DiscardUnknown ¶
func (m *Conflict) XXX_DiscardUnknown()
func (*Conflict) XXX_Marshal ¶
func (*Conflict) XXX_Unmarshal ¶
type Entry ¶
type Entry struct { // Kind encodes the type of filesystem entry being represented. Kind EntryKind `protobuf:"varint,1,opt,name=kind,proto3,enum=sync.EntryKind" json:"kind,omitempty"` // Contents represents a directory entry's contents. Contents map[string]*Entry `` /* 157-byte string literal not displayed */ // Digest represents the hash of a file entry's contents. Digest []byte `protobuf:"bytes,8,opt,name=digest,proto3" json:"digest,omitempty"` // Executable indicates whether or not a file entry is marked as executable. Executable bool `protobuf:"varint,9,opt,name=executable,proto3" json:"executable,omitempty"` // Target is the symlink target for symlink entries. Target string `protobuf:"bytes,12,opt,name=target,proto3" json:"target,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Entry represents a filesystem node (e.g. a directory, a file, or a symlink).
func Apply ¶
Apply applies a series of changes to a base entry. This function ignores the Old value for changes and it assumes all changes are valid to apply against the base.
func PropagateExecutability ¶
PropagateExecutability propagates file executability from the ancestor and source to the target in a recursive fashion. Executability information is only propagated if entry paths, types, and contents match, with source taking precedent over ancestor.
func (*Entry) Count ¶ added in v0.8.0
Count returns the total number of entries within the entry hierarchy rooted at the entry.
func (*Entry) Descriptor ¶
func (*Entry) EnsureValid ¶
EnsureValid ensures that Entry's invariants are respected.
func (*Entry) Equal ¶
Equal determines whether or not another entry is entirely (recursively) equal to this one.
func (*Entry) GetContents ¶
func (*Entry) GetExecutable ¶
func (*Entry) ProtoMessage ¶
func (*Entry) ProtoMessage()
func (*Entry) XXX_DiscardUnknown ¶
func (m *Entry) XXX_DiscardUnknown()
func (*Entry) XXX_Marshal ¶
func (*Entry) XXX_Unmarshal ¶
type EntryKind ¶
type EntryKind int32
EntryKind encodes the type of entry represented by an Entry object.
func (EntryKind) EnumDescriptor ¶
type IgnoreCache ¶ added in v0.6.0
type IgnoreCache map[IgnoreCacheKey]bool
IgnoreCache provides an efficient mechanism to avoid recomputing ignores.
type IgnoreCacheKey ¶ added in v0.6.0
type IgnoreCacheKey struct {
// contains filtered or unexported fields
}
IgnoreCacheKey represents a key in an ignore cache.
type IgnoreVCSMode ¶
type IgnoreVCSMode int32
IgnoreVCSMode specifies the mode for ignoring VCS directories.
const ( // IgnoreVCSMode_IgnoreVCSModeDefault represents an unspecified VCS ignore // mode. It is not valid for use with Scan. It should be converted to one of // the following values based on the desired default behavior. IgnoreVCSMode_IgnoreVCSModeDefault IgnoreVCSMode = 0 // IgnoreVCSMode_IgnoreVCSModeIgnore indicates that VCS directories should // be ignored. IgnoreVCSMode_IgnoreVCSModeIgnore IgnoreVCSMode = 1 // IgnoreVCSMode_IgnoreVCSModePropagate indicates that VCS directories // should be propagated. IgnoreVCSMode_IgnoreVCSModePropagate IgnoreVCSMode = 2 )
func (IgnoreVCSMode) Description ¶
func (m IgnoreVCSMode) Description() string
Description returns a human-readable description of a VCS ignore mode.
func (IgnoreVCSMode) EnumDescriptor ¶
func (IgnoreVCSMode) EnumDescriptor() ([]byte, []int)
func (IgnoreVCSMode) IsDefault ¶ added in v0.8.0
func (m IgnoreVCSMode) IsDefault() bool
IsDefault indicates whether or not the VCS ignore mode is IgnoreVCSMode_IgnoreVCSModeDefault.
func (IgnoreVCSMode) String ¶
func (x IgnoreVCSMode) String() string
func (IgnoreVCSMode) Supported ¶
func (m IgnoreVCSMode) Supported() bool
Supported indicates whether or not a particular VCS ignore mode is a valid, non-default value.
func (*IgnoreVCSMode) UnmarshalText ¶
func (m *IgnoreVCSMode) UnmarshalText(textBytes []byte) error
UnmarshalText implements the text unmarshalling interface used when loading from TOML files.
type Problem ¶
type Problem struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Problem) Descriptor ¶
func (*Problem) EnsureValid ¶
EnsureValid ensures that Problem's invariants are respected.
func (*Problem) ProtoMessage ¶
func (*Problem) ProtoMessage()
func (*Problem) XXX_DiscardUnknown ¶
func (m *Problem) XXX_DiscardUnknown()
func (*Problem) XXX_Marshal ¶
func (*Problem) XXX_Unmarshal ¶
type Provider ¶
type Provider interface { // Provide returns a filesystem path to a file containing the contents for // the path given as the first argument with the digest specified by the // second argument. If the provider is unable to locate a file matching the // specified parameters in its internal storage, it should return an error // for which os.IsNotExist evaluates to true. Provide(path string, digest []byte) (string, error) }
Provider defines the interface that higher-level logic can use to provide files to transition algorithms.
type ReverseLookupMap ¶ added in v0.5.0
type ReverseLookupMap struct {
// contains filtered or unexported fields
}
ReverseLookupMap provides facilities for doing reverse lookups to avoid expensive staging operations in the case of renames and copies.
type SymlinkMode ¶
type SymlinkMode int32
SymlinkMode specifies the mode for handling the propagation of symlinks.
const ( // SymlinkMode_SymlinkModeDefault represents an unspecified symlink mode. It // is not valid for use with Scan or Transition. It should be converted to // one of the following values based on the desired default behavior. SymlinkMode_SymlinkModeDefault SymlinkMode = 0 // SymlinkMode_SymlinkModeIgnore specifies that all symlinks should be // ignored. SymlinkMode_SymlinkModeIgnore SymlinkMode = 1 // SymlinkMode_SymlinkModePortable specifies that only portable symlinks // should be synchronized. If a symlink is found during a scan operation // that it is not portable, it halts the scan and synchronization. The // reason for this is that it can't simply be ignored/unignored as desired // without breaking the three-way merge. SymlinkMode_SymlinkModePortable SymlinkMode = 2 // SymlinkMode_SymlinkModePOSIXRaw specifies that symlinks should be // propagated in their raw form. It is only valid on POSIX systems and only // makes sense in the context of POSIX-to-POSIX synchronization. SymlinkMode_SymlinkModePOSIXRaw SymlinkMode = 3 )
func (SymlinkMode) Description ¶
func (m SymlinkMode) Description() string
Description returns a human-readable description of a symlink mode.
func (SymlinkMode) EnumDescriptor ¶
func (SymlinkMode) EnumDescriptor() ([]byte, []int)
func (SymlinkMode) IsDefault ¶ added in v0.8.0
func (m SymlinkMode) IsDefault() bool
IsDefault indicates whether or not the symbolic link handling mode is SymlinkMode_SymlinkModeDefault.
func (SymlinkMode) String ¶
func (x SymlinkMode) String() string
func (SymlinkMode) Supported ¶
func (m SymlinkMode) Supported() bool
Supported indicates whether or not a particular symlink mode is a valid, non-default value.
func (*SymlinkMode) UnmarshalText ¶
func (m *SymlinkMode) UnmarshalText(textBytes []byte) error
UnmarshalText implements the text unmarshalling interface used when loading from TOML files.
type SynchronizationMode ¶ added in v0.8.0
type SynchronizationMode int32
SynchronizationMode specifies the mode for synchronization, encoding both directionality and conflict resolution behavior.
const ( // SynchronizationMode_SynchronizationModeDefault represents an unspecified // synchronization mode. It is not valid for use with Reconcile. It should // be converted to one of the following values based on the desired default // behavior. SynchronizationMode_SynchronizationModeDefault SynchronizationMode = 0 // SynchronizationMode_SynchronizationModeTwoWaySafe represents a // bidirectional synchronization mode where automatic conflict resolution is // performed only in cases where no data would be lost. Specifically, this // means that modified contents are allowed to propagate to the opposite // endpoint if the corresponding contents on the opposite endpoint are // unmodified or deleted. All other conflicts are left unresolved. SynchronizationMode_SynchronizationModeTwoWaySafe SynchronizationMode = 1 // SynchronizationMode_SynchronizationModeTwoWayResolved is the same as // SynchronizationMode_SynchronizationModeTwoWaySafe, but specifies that the // alpha endpoint should win automatically in any conflict between alpha and // beta, including cases where alpha has deleted contents that beta has // modified. SynchronizationMode_SynchronizationModeTwoWayResolved SynchronizationMode = 2 // SynchronizationMode_SynchronizationModeOneWaySafe represents a // unidirectional synchronization mode where contents and changes propagate // from alpha to beta, but won't overwrite any creations or modifications on // beta. SynchronizationMode_SynchronizationModeOneWaySafe SynchronizationMode = 3 // SynchronizationMode_SynchronizationModeOneWayReplica represents a // unidirectional synchronization mode where contents on alpha are mirrored // (verbatim) to beta, overwriting any conflicting contents on beta and // deleting any extraneous contents on beta. SynchronizationMode_SynchronizationModeOneWayReplica SynchronizationMode = 4 )
func (SynchronizationMode) Description ¶ added in v0.8.0
func (m SynchronizationMode) Description() string
Description returns a human-readable description of a synchronization mode.
func (SynchronizationMode) EnumDescriptor ¶ added in v0.8.0
func (SynchronizationMode) EnumDescriptor() ([]byte, []int)
func (SynchronizationMode) IsDefault ¶ added in v0.8.0
func (m SynchronizationMode) IsDefault() bool
IsDefault indicates whether or not the synchronization mode is SynchronizationMode_SynchronizationModeDefault.
func (SynchronizationMode) String ¶ added in v0.8.0
func (x SynchronizationMode) String() string
func (SynchronizationMode) Supported ¶ added in v0.8.0
func (m SynchronizationMode) Supported() bool
Supported indicates whether or not a particular synchronization mode is a valid, non-default value.
func (*SynchronizationMode) UnmarshalText ¶ added in v0.8.0
func (m *SynchronizationMode) UnmarshalText(textBytes []byte) error
UnmarshalText implements the text unmarshalling interface used when loading from TOML files.
Source Files
¶
- apply.go
- archive.go
- archive.pb.go
- cache.go
- cache.pb.go
- change.go
- change.pb.go
- conflict.go
- conflict.pb.go
- diff.go
- doc.go
- entry.go
- entry.pb.go
- executability.go
- ignore.go
- ignore_vcs.go
- ignore_vcs_mode.go
- ignore_vcs_mode.pb.go
- iterate.go
- mode.go
- mode.pb.go
- path.go
- permissions.go
- problem.go
- problem.pb.go
- reconcile.go
- scan.go
- stage.go
- symlink.go
- symlink_mode.go
- symlink_mode.pb.go
- transition.go