sync

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: MIT Imports: 19 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var DefaultVCSIgnores = []string{
	".git/",
	".svn/",
	".hg/",
	".bzr/",
	"_darcs/",
}

DefaultVCSIgnores is the default set of ignores to use when ignoring VCS directories.

View Source
var EntryKind_name = map[int32]string{
	0: "Directory",
	1: "File",
	2: "Symlink",
}
View Source
var EntryKind_value = map[string]int32{
	"Directory": 0,
	"File":      1,
	"Symlink":   2,
}
View Source
var IgnoreVCSMode_name = map[int32]string{
	0: "IgnoreVCSModeDefault",
	1: "IgnoreVCSModeIgnore",
	2: "IgnoreVCSModePropagate",
}
View Source
var IgnoreVCSMode_value = map[string]int32{
	"IgnoreVCSModeDefault":   0,
	"IgnoreVCSModeIgnore":    1,
	"IgnoreVCSModePropagate": 2,
}
View Source
var SymlinkMode_name = map[int32]string{
	0: "SymlinkModeDefault",
	1: "SymlinkModeIgnore",
	2: "SymlinkModePortable",
	3: "SymlinkModePOSIXRaw",
}
View Source
var SymlinkMode_value = map[string]int32{
	"SymlinkModeDefault":  0,
	"SymlinkModeIgnore":   1,
	"SymlinkModePortable": 2,
	"SymlinkModePOSIXRaw": 3,
}
View Source
var SynchronizationMode_name = map[int32]string{
	0: "SynchronizationModeDefault",
	1: "SynchronizationModeTwoWaySafe",
	2: "SynchronizationModeTwoWayResolved",
	3: "SynchronizationModeOneWaySafe",
	4: "SynchronizationModeOneWayReplica",
}
View Source
var SynchronizationMode_value = map[string]int32{
	"SynchronizationModeDefault":        0,
	"SynchronizationModeTwoWaySafe":     1,
	"SynchronizationModeTwoWayResolved": 2,
	"SynchronizationModeOneWaySafe":     3,
	"SynchronizationModeOneWayReplica":  4,
}

Functions

func EnsureDefaultDirectoryModeValid added in v0.8.0

func EnsureDefaultDirectoryModeValid(mode fs.Mode) error

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

func EnsureDefaultFileModeValid(mode fs.Mode) error

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

func PathBase(path string) string

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

func TransitionDependencies(transitions []*Change) ([]string, [][]byte, error)

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

func ValidIgnorePattern(pattern string) bool

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) Descriptor() ([]byte, []int)

func (*Archive) EnsureValid added in v0.7.0

func (a *Archive) EnsureValid() error

func (*Archive) GetRoot

func (m *Archive) GetRoot() *Entry

func (*Archive) ProtoMessage

func (*Archive) ProtoMessage()

func (*Archive) Reset

func (m *Archive) Reset()

func (*Archive) String

func (m *Archive) String() string

func (*Archive) XXX_DiscardUnknown

func (m *Archive) XXX_DiscardUnknown()

func (*Archive) XXX_Marshal

func (m *Archive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Archive) XXX_Merge

func (m *Archive) XXX_Merge(src proto.Message)

func (*Archive) XXX_Size

func (m *Archive) XXX_Size() int

func (*Archive) XXX_Unmarshal

func (m *Archive) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*Cache) EnsureValid

func (c *Cache) EnsureValid() error

EnsureValid ensures that Cache's invariants are respected.

func (*Cache) Equal added in v0.9.0

func (c *Cache) Equal(other *Cache) bool

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) Reset

func (m *Cache) Reset()

func (*Cache) String

func (m *Cache) String() string

func (*Cache) XXX_DiscardUnknown

func (m *Cache) XXX_DiscardUnknown()

func (*Cache) XXX_Marshal

func (m *Cache) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Cache) XXX_Merge

func (m *Cache) XXX_Merge(src proto.Message)

func (*Cache) XXX_Size

func (m *Cache) XXX_Size() int

func (*Cache) XXX_Unmarshal

func (m *Cache) XXX_Unmarshal(b []byte) error

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

func Diff(base, target *Entry) []*Change

Diff performs a diff operation from the base to the target entry, generating a list of changes.

func (*Change) Descriptor

func (*Change) Descriptor() ([]byte, []int)

func (*Change) EnsureValid

func (c *Change) EnsureValid() error

EnsureValid ensures that Change's invariants are respected.

func (*Change) GetNew

func (m *Change) GetNew() *Entry

func (*Change) GetOld

func (m *Change) GetOld() *Entry

func (*Change) GetPath

func (m *Change) GetPath() string

func (*Change) ProtoMessage

func (*Change) ProtoMessage()

func (*Change) Reset

func (m *Change) Reset()

func (*Change) String

func (m *Change) String() string

func (*Change) XXX_DiscardUnknown

func (m *Change) XXX_DiscardUnknown()

func (*Change) XXX_Marshal

func (m *Change) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Change) XXX_Merge

func (m *Change) XXX_Merge(src proto.Message)

func (*Change) XXX_Size

func (m *Change) XXX_Size() int

func (*Change) XXX_Unmarshal

func (m *Change) XXX_Unmarshal(b []byte) error

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

func (c *Conflict) CopySlim() *Conflict

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) Descriptor() ([]byte, []int)

func (*Conflict) EnsureValid

func (c *Conflict) EnsureValid() error

EnsureValid ensures that Conflict's invariants are respected.

func (*Conflict) GetAlphaChanges

func (m *Conflict) GetAlphaChanges() []*Change

func (*Conflict) GetBetaChanges

func (m *Conflict) GetBetaChanges() []*Change

func (*Conflict) ProtoMessage

func (*Conflict) ProtoMessage()

func (*Conflict) Reset

func (m *Conflict) Reset()

func (*Conflict) Root added in v0.8.0

func (c *Conflict) Root() string

Root returns the root path for a conflict.

func (*Conflict) String

func (m *Conflict) String() string

func (*Conflict) XXX_DiscardUnknown

func (m *Conflict) XXX_DiscardUnknown()

func (*Conflict) XXX_Marshal

func (m *Conflict) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Conflict) XXX_Merge

func (m *Conflict) XXX_Merge(src proto.Message)

func (*Conflict) XXX_Size

func (m *Conflict) XXX_Size() int

func (*Conflict) XXX_Unmarshal

func (m *Conflict) XXX_Unmarshal(b []byte) error

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

func Apply(base *Entry, changes []*Change) (*Entry, error)

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

func PropagateExecutability(ancestor, source, target *Entry) *Entry

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) Copy

func (e *Entry) Copy() *Entry

Copy creates a deep copy of the entry.

func (*Entry) Count added in v0.8.0

func (e *Entry) Count() uint64

Count returns the total number of entries within the entry hierarchy rooted at the entry.

func (*Entry) Descriptor

func (*Entry) Descriptor() ([]byte, []int)

func (*Entry) EnsureValid

func (e *Entry) EnsureValid() error

EnsureValid ensures that Entry's invariants are respected.

func (*Entry) Equal

func (e *Entry) Equal(other *Entry) bool

Equal determines whether or not another entry is entirely (recursively) equal to this one.

func (*Entry) GetContents

func (m *Entry) GetContents() map[string]*Entry

func (*Entry) GetDigest

func (m *Entry) GetDigest() []byte

func (*Entry) GetExecutable

func (m *Entry) GetExecutable() bool

func (*Entry) GetKind

func (m *Entry) GetKind() EntryKind

func (*Entry) GetTarget

func (m *Entry) GetTarget() string

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) Reset

func (m *Entry) Reset()

func (*Entry) String

func (m *Entry) String() string

func (*Entry) XXX_DiscardUnknown

func (m *Entry) XXX_DiscardUnknown()

func (*Entry) XXX_Marshal

func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Entry) XXX_Merge

func (m *Entry) XXX_Merge(src proto.Message)

func (*Entry) XXX_Size

func (m *Entry) XXX_Size() int

func (*Entry) XXX_Unmarshal

func (m *Entry) XXX_Unmarshal(b []byte) error

type EntryKind

type EntryKind int32

EntryKind encodes the type of entry represented by an Entry object.

const (
	// EntryKind_Directory represents a directory entry.
	EntryKind_Directory EntryKind = 0
	// EntryKind_File represents a file entry.
	EntryKind_File EntryKind = 1
	// EntryKind_Symlink represents a symlink entry.
	EntryKind_Symlink EntryKind = 2
)

func (EntryKind) EnumDescriptor

func (EntryKind) EnumDescriptor() ([]byte, []int)

func (EntryKind) String

func (x EntryKind) String() string

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) Descriptor() ([]byte, []int)

func (*Problem) EnsureValid

func (p *Problem) EnsureValid() error

EnsureValid ensures that Problem's invariants are respected.

func (*Problem) GetError

func (m *Problem) GetError() string

func (*Problem) GetPath

func (m *Problem) GetPath() string

func (*Problem) ProtoMessage

func (*Problem) ProtoMessage()

func (*Problem) Reset

func (m *Problem) Reset()

func (*Problem) String

func (m *Problem) String() string

func (*Problem) XXX_DiscardUnknown

func (m *Problem) XXX_DiscardUnknown()

func (*Problem) XXX_Marshal

func (m *Problem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Problem) XXX_Merge

func (m *Problem) XXX_Merge(src proto.Message)

func (*Problem) XXX_Size

func (m *Problem) XXX_Size() int

func (*Problem) XXX_Unmarshal

func (m *Problem) XXX_Unmarshal(b []byte) error

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.

func (*ReverseLookupMap) Lookup added in v0.5.0

func (m *ReverseLookupMap) Lookup(digest []byte) (string, bool)

Lookup attempts a lookup in the map.

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.

Jump to

Keyboard shortcuts

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