Documentation
¶
Overview ¶
Package session provides session management facilities, including the core synchronization loop logic. It is the highest-level package in Mutagen, tying together all synchronization, transport, and coordination logic.
Index ¶
- Variables
- type Configuration
- func (*Configuration) Descriptor() ([]byte, []int)deprecated
- func (c *Configuration) EnsureValid(endpointSpecific bool) error
- func (c *Configuration) Equal(other *Configuration) bool
- func (x *Configuration) GetDefaultDirectoryMode() uint32
- func (x *Configuration) GetDefaultFileMode() uint32
- func (x *Configuration) GetDefaultGroup() string
- func (x *Configuration) GetDefaultIgnores() []string
- func (x *Configuration) GetDefaultOwner() string
- func (x *Configuration) GetIgnoreVCSMode() core.IgnoreVCSMode
- func (x *Configuration) GetIgnores() []string
- func (x *Configuration) GetMaximumEntryCount() uint64
- func (x *Configuration) GetMaximumStagingFileSize() uint64
- func (x *Configuration) GetProbeMode() behavior.ProbeMode
- func (x *Configuration) GetScanMode() ScanMode
- func (x *Configuration) GetStageMode() StageMode
- func (x *Configuration) GetSymlinkMode() core.SymlinkMode
- func (x *Configuration) GetSynchronizationMode() core.SynchronizationMode
- func (x *Configuration) GetWatchMode() WatchMode
- func (x *Configuration) GetWatchPollingInterval() uint32
- func (*Configuration) ProtoMessage()
- func (x *Configuration) ProtoReflect() protoreflect.Message
- func (x *Configuration) Reset()
- func (x *Configuration) String() string
- type Endpoint
- type Manager
- func (m *Manager) Create(ctx context.Context, alpha, beta *url.URL, ...) (string, error)
- func (m *Manager) Flush(ctx context.Context, selection *selection.Selection, prompter string, ...) error
- func (m *Manager) List(_ context.Context, selection *selection.Selection, previousStateIndex uint64) (uint64, []*State, error)
- func (m *Manager) Pause(ctx context.Context, selection *selection.Selection, prompter string) error
- func (m *Manager) Reset(ctx context.Context, selection *selection.Selection, prompter string) error
- func (m *Manager) Resume(ctx context.Context, selection *selection.Selection, prompter string) error
- func (m *Manager) Shutdown()
- func (m *Manager) Terminate(ctx context.Context, selection *selection.Selection, prompter string) error
- type ProtocolHandler
- type ScanMode
- func (m ScanMode) Description() string
- func (ScanMode) Descriptor() protoreflect.EnumDescriptor
- func (x ScanMode) Enum() *ScanMode
- func (ScanMode) EnumDescriptor() ([]byte, []int)deprecated
- func (m ScanMode) IsDefault() bool
- func (x ScanMode) Number() protoreflect.EnumNumber
- func (x ScanMode) String() string
- func (m ScanMode) Supported() bool
- func (ScanMode) Type() protoreflect.EnumType
- func (m *ScanMode) UnmarshalText(textBytes []byte) error
- type Session
- func (*Session) Descriptor() ([]byte, []int)deprecated
- func (s *Session) EnsureValid() error
- func (x *Session) GetAlpha() *url.URL
- func (x *Session) GetBeta() *url.URL
- func (x *Session) GetConfiguration() *Configuration
- func (x *Session) GetConfigurationAlpha() *Configuration
- func (x *Session) GetConfigurationBeta() *Configuration
- func (x *Session) GetCreatingVersionMajor() uint32
- func (x *Session) GetCreatingVersionMinor() uint32
- func (x *Session) GetCreatingVersionPatch() uint32
- func (x *Session) GetCreationTime() *timestamp.Timestamp
- func (x *Session) GetIdentifier() string
- func (x *Session) GetLabels() map[string]string
- func (x *Session) GetName() string
- func (x *Session) GetPaused() bool
- func (x *Session) GetVersion() Version
- func (*Session) ProtoMessage()
- func (x *Session) ProtoReflect() protoreflect.Message
- func (x *Session) Reset()
- func (x *Session) String() string
- type StageMode
- func (m StageMode) Description() string
- func (StageMode) Descriptor() protoreflect.EnumDescriptor
- func (x StageMode) Enum() *StageMode
- func (StageMode) EnumDescriptor() ([]byte, []int)deprecated
- func (m StageMode) IsDefault() bool
- func (x StageMode) Number() protoreflect.EnumNumber
- func (x StageMode) String() string
- func (m StageMode) Supported() bool
- func (StageMode) Type() protoreflect.EnumType
- func (m *StageMode) UnmarshalText(textBytes []byte) error
- type State
- func (s *State) Copy() *State
- func (*State) Descriptor() ([]byte, []int)deprecated
- func (s *State) EnsureValid() error
- func (x *State) GetAlphaConnected() bool
- func (x *State) GetAlphaProblems() []*core.Problem
- func (x *State) GetBetaConnected() bool
- func (x *State) GetBetaProblems() []*core.Problem
- func (x *State) GetConflicts() []*core.Conflict
- func (x *State) GetLastError() string
- func (x *State) GetSession() *Session
- func (x *State) GetStagingStatus() *rsync.ReceiverStatus
- func (x *State) GetStatus() Status
- func (x *State) GetSuccessfulSynchronizationCycles() uint64
- func (x *State) GetTruncatedAlphaProblems() uint64
- func (x *State) GetTruncatedBetaProblems() uint64
- func (x *State) GetTruncatedConflicts() uint64
- func (*State) ProtoMessage()
- func (x *State) ProtoReflect() protoreflect.Message
- func (x *State) Reset()
- func (x *State) String() string
- type Status
- func (s Status) Description() string
- func (Status) Descriptor() protoreflect.EnumDescriptor
- func (x Status) Enum() *Status
- func (Status) EnumDescriptor() ([]byte, []int)deprecated
- func (x Status) Number() protoreflect.EnumNumber
- func (x Status) String() string
- func (Status) Type() protoreflect.EnumType
- type Version
- func (v Version) DefaultDirectoryMode() filesystem.Mode
- func (v Version) DefaultFileMode() filesystem.Mode
- func (v Version) DefaultGroupSpecification() string
- func (v Version) DefaultIgnoreVCSMode() core.IgnoreVCSMode
- func (v Version) DefaultMaximumEntryCount() uint64
- func (v Version) DefaultMaximumStagingFileSize() uint64
- func (v Version) DefaultOwnerSpecification() string
- func (v Version) DefaultProbeMode() behavior.ProbeMode
- func (v Version) DefaultScanMode() ScanMode
- func (v Version) DefaultStageMode() StageMode
- func (v Version) DefaultSymlinkMode() core.SymlinkMode
- func (v Version) DefaultSynchronizationMode() core.SynchronizationMode
- func (v Version) DefaultWatchMode() WatchMode
- func (v Version) DefaultWatchPollingInterval() uint32
- func (Version) Descriptor() protoreflect.EnumDescriptor
- func (x Version) Enum() *Version
- func (Version) EnumDescriptor() ([]byte, []int)deprecated
- func (v Version) Hasher() hash.Hash
- func (x Version) Number() protoreflect.EnumNumber
- func (x Version) String() string
- func (v Version) Supported() bool
- func (Version) Type() protoreflect.EnumType
- type WatchMode
- func (m WatchMode) Description() string
- func (WatchMode) Descriptor() protoreflect.EnumDescriptor
- func (x WatchMode) Enum() *WatchMode
- func (WatchMode) EnumDescriptor() ([]byte, []int)deprecated
- func (m WatchMode) IsDefault() bool
- func (x WatchMode) Number() protoreflect.EnumNumber
- func (x WatchMode) String() string
- func (m WatchMode) Supported() bool
- func (WatchMode) Type() protoreflect.EnumType
- func (m *WatchMode) UnmarshalText(textBytes []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ScanMode_name = map[int32]string{ 0: "ScanModeDefault", 1: "ScanModeFull", 2: "ScanModeAccelerated", } ScanMode_value = map[string]int32{ "ScanModeDefault": 0, "ScanModeFull": 1, "ScanModeAccelerated": 2, } )
Enum value maps for ScanMode.
var ( StageMode_name = map[int32]string{ 0: "StageModeDefault", 1: "StageModeMutagen", 2: "StageModeNeighboring", } StageMode_value = map[string]int32{ "StageModeDefault": 0, "StageModeMutagen": 1, "StageModeNeighboring": 2, } )
Enum value maps for StageMode.
var ( Status_name = map[int32]string{ 0: "Disconnected", 1: "HaltedOnRootEmptied", 2: "HaltedOnRootDeletion", 3: "HaltedOnRootTypeChange", 4: "ConnectingAlpha", 5: "ConnectingBeta", 6: "Watching", 7: "Scanning", 8: "WaitingForRescan", 9: "Reconciling", 10: "StagingAlpha", 11: "StagingBeta", 12: "Transitioning", 13: "Saving", } Status_value = map[string]int32{ "Disconnected": 0, "HaltedOnRootEmptied": 1, "HaltedOnRootDeletion": 2, "HaltedOnRootTypeChange": 3, "ConnectingAlpha": 4, "ConnectingBeta": 5, "Watching": 6, "Scanning": 7, "WaitingForRescan": 8, "Reconciling": 9, "StagingAlpha": 10, "StagingBeta": 11, "Transitioning": 12, "Saving": 13, } )
Enum value maps for Status.
var ( Version_name = map[int32]string{ 0: "Invalid", 1: "Version1", } Version_value = map[string]int32{ "Invalid": 0, "Version1": 1, } )
Enum value maps for Version.
var ( WatchMode_name = map[int32]string{ 0: "WatchModeDefault", 1: "WatchModePortable", 2: "WatchModeForcePoll", 3: "WatchModeNoWatch", } WatchMode_value = map[string]int32{ "WatchModeDefault": 0, "WatchModePortable": 1, "WatchModeForcePoll": 2, "WatchModeNoWatch": 3, } )
Enum value maps for WatchMode.
var File_synchronization_configuration_proto protoreflect.FileDescriptor
var File_synchronization_scan_mode_proto protoreflect.FileDescriptor
var File_synchronization_session_proto protoreflect.FileDescriptor
var File_synchronization_stage_mode_proto protoreflect.FileDescriptor
var File_synchronization_state_proto protoreflect.FileDescriptor
var File_synchronization_version_proto protoreflect.FileDescriptor
var File_synchronization_watch_mode_proto protoreflect.FileDescriptor
var ProtocolHandlers = map[urlpkg.Protocol]ProtocolHandler{}
ProtocolHandlers is a map of registered protocol handlers. It should only be modified during init() operations.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { // SynchronizationMode specifies the synchronization mode that should be // used in synchronization. SynchronizationMode core.SynchronizationMode `protobuf:"varint,11,opt,name=synchronizationMode,proto3,enum=core.SynchronizationMode" json:"synchronizationMode,omitempty"` // MaximumEntryCount specifies the maximum number of filesystem entries that // endpoints will tolerate managing. A zero value indicates no limit. MaximumEntryCount uint64 `protobuf:"varint,12,opt,name=maximumEntryCount,proto3" json:"maximumEntryCount,omitempty"` // MaximumStagingFileSize is the maximum (individual) file size that // endpoints will stage. A zero value indicates no limit. MaximumStagingFileSize uint64 `protobuf:"varint,13,opt,name=maximumStagingFileSize,proto3" json:"maximumStagingFileSize,omitempty"` // ProbeMode specifies the filesystem probing mode. ProbeMode behavior.ProbeMode `protobuf:"varint,14,opt,name=probeMode,proto3,enum=behavior.ProbeMode" json:"probeMode,omitempty"` // ScanMode specifies the synchronization root scanning mode. ScanMode ScanMode `protobuf:"varint,15,opt,name=scanMode,proto3,enum=synchronization.ScanMode" json:"scanMode,omitempty"` // StageMode specifies the file staging mode. StageMode StageMode `protobuf:"varint,16,opt,name=stageMode,proto3,enum=synchronization.StageMode" json:"stageMode,omitempty"` // SymlinkMode specifies the symlink mode that should be used in // synchronization. SymlinkMode core.SymlinkMode `protobuf:"varint,1,opt,name=symlinkMode,proto3,enum=core.SymlinkMode" json:"symlinkMode,omitempty"` // WatchMode specifies the filesystem watching mode. WatchMode WatchMode `protobuf:"varint,21,opt,name=watchMode,proto3,enum=synchronization.WatchMode" json:"watchMode,omitempty"` // WatchPollingInterval specifies the interval (in seconds) for poll-based // file monitoring. A value of 0 specifies that the default interval should // be used. WatchPollingInterval uint32 `protobuf:"varint,22,opt,name=watchPollingInterval,proto3" json:"watchPollingInterval,omitempty"` // DefaultIgnores specifies the ignore patterns brought in from the global // configuration. // DEPRECATED: This field is no longer used when loading from global // configuration. Instead, ignores provided by global configuration are // simply merged into the ignore list of the main configuration. However, // older sessions still use this field. DefaultIgnores []string `protobuf:"bytes,31,rep,name=defaultIgnores,proto3" json:"defaultIgnores,omitempty"` // Ignores specifies the ignore patterns brought in from the create request. Ignores []string `protobuf:"bytes,32,rep,name=ignores,proto3" json:"ignores,omitempty"` // IgnoreVCSMode specifies the VCS ignore mode that should be used in // synchronization. IgnoreVCSMode core.IgnoreVCSMode `protobuf:"varint,33,opt,name=ignoreVCSMode,proto3,enum=core.IgnoreVCSMode" json:"ignoreVCSMode,omitempty"` // DefaultFileMode specifies the default permission mode to use for new // files in "portable" permission propagation mode. DefaultFileMode uint32 `protobuf:"varint,63,opt,name=defaultFileMode,proto3" json:"defaultFileMode,omitempty"` // DefaultDirectoryMode specifies the default permission mode to use for new // files in "portable" permission propagation mode. DefaultDirectoryMode uint32 `protobuf:"varint,64,opt,name=defaultDirectoryMode,proto3" json:"defaultDirectoryMode,omitempty"` // DefaultOwner specifies the default owner identifier to use when setting // ownership of new files and directories in "portable" permission // propagation mode. DefaultOwner string `protobuf:"bytes,65,opt,name=defaultOwner,proto3" json:"defaultOwner,omitempty"` // DefaultGroup specifies the default group identifier to use when setting // ownership of new files and directories in "portable" permission // propagation mode. DefaultGroup string `protobuf:"bytes,66,opt,name=defaultGroup,proto3" json:"defaultGroup,omitempty"` // contains filtered or unexported fields }
Configuration encodes session configuration parameters. It is used for create commands to specify configuration options, for loading global configuration options, and for storing a merged configuration inside sessions.
func MergeConfigurations ¶
func MergeConfigurations(lower, higher *Configuration) *Configuration
MergeConfigurations merges two configurations of differing priorities. Both configurations must be non-nil.
func (*Configuration) Descriptor
deprecated
func (*Configuration) Descriptor() ([]byte, []int)
Deprecated: Use Configuration.ProtoReflect.Descriptor instead.
func (*Configuration) EnsureValid ¶
func (c *Configuration) EnsureValid(endpointSpecific bool) error
EnsureValid ensures that Configuration's invariants are respected. The validation of the configuration depends on whether or not it is endpoint-specific.
func (*Configuration) Equal ¶ added in v0.12.0
func (c *Configuration) Equal(other *Configuration) bool
Equal returns whether or not the configuration is equivalent to another. The result of this method is only valid if both configurations are valid.
func (*Configuration) GetDefaultDirectoryMode ¶
func (x *Configuration) GetDefaultDirectoryMode() uint32
func (*Configuration) GetDefaultFileMode ¶
func (x *Configuration) GetDefaultFileMode() uint32
func (*Configuration) GetDefaultGroup ¶
func (x *Configuration) GetDefaultGroup() string
func (*Configuration) GetDefaultIgnores ¶
func (x *Configuration) GetDefaultIgnores() []string
func (*Configuration) GetDefaultOwner ¶
func (x *Configuration) GetDefaultOwner() string
func (*Configuration) GetIgnoreVCSMode ¶
func (x *Configuration) GetIgnoreVCSMode() core.IgnoreVCSMode
func (*Configuration) GetIgnores ¶
func (x *Configuration) GetIgnores() []string
func (*Configuration) GetMaximumEntryCount ¶
func (x *Configuration) GetMaximumEntryCount() uint64
func (*Configuration) GetMaximumStagingFileSize ¶
func (x *Configuration) GetMaximumStagingFileSize() uint64
func (*Configuration) GetProbeMode ¶
func (x *Configuration) GetProbeMode() behavior.ProbeMode
func (*Configuration) GetScanMode ¶
func (x *Configuration) GetScanMode() ScanMode
func (*Configuration) GetStageMode ¶
func (x *Configuration) GetStageMode() StageMode
func (*Configuration) GetSymlinkMode ¶
func (x *Configuration) GetSymlinkMode() core.SymlinkMode
func (*Configuration) GetSynchronizationMode ¶
func (x *Configuration) GetSynchronizationMode() core.SynchronizationMode
func (*Configuration) GetWatchMode ¶
func (x *Configuration) GetWatchMode() WatchMode
func (*Configuration) GetWatchPollingInterval ¶
func (x *Configuration) GetWatchPollingInterval() uint32
func (*Configuration) ProtoMessage ¶
func (*Configuration) ProtoMessage()
func (*Configuration) ProtoReflect ¶ added in v0.12.0
func (x *Configuration) ProtoReflect() protoreflect.Message
func (*Configuration) Reset ¶
func (x *Configuration) Reset()
func (*Configuration) String ¶
func (x *Configuration) String() string
type Endpoint ¶
type Endpoint interface { // Poll performs a one-shot poll for filesystem modifications in the // endpoint's root. It blocks until an event occurs, the provided context is // cancelled, or an error occurs. In the first two cases it returns nil. The // provided context is guaranteed to be cancelled eventually. Poll(ctx context.Context) error // Scan performs a scan of the endpoint's synchronization root. It allows // the ancestor to be passed in for optimized snapshot transfers if the // endpoint is remote. The ancestor may be nil, in which transfers from // remote endpoints may be less than optimal. The full parameter forces the // function to perform a full (warm) scan, avoiding any acceleration that // might be available on the endpoint. The function returns the scan result, // a boolean indicating whether or not the synchronization root preserves // POSIX executability bits, any error that occurred while trying to create // the scan, and a boolean indicating whether or not to re-try the scan (in // the event of an error). Scan(ctx context.Context, ancestor *core.Entry, full bool) (*core.Entry, bool, error, bool) // Stage performs staging on the endpoint. It accepts a list of file paths // and a separate list of desired digests corresponding to those paths. For // performance reasons, the paths should be passed in depth-first traversal // order. This method will filter the list based on what it already has // staged from previously interrupted stagings and what can be staged from // local contents (e.g. in cases of renames and copies), and then return a // list of paths, their signatures, and a receiver to receive them. The // returned path list must maintain relative ordering for its filtered // paths, again for performance reasons. If the list of paths is empty, then // all paths were either already staged or able to be staged from local // data, and the receiver will be nil. Otherwise, the receiver will be // non-nil and must be finalized (i.e. transmitted to) before subsequent // methods can be invoked on the endpoint. This method is allowed to modify // the argument slices. If the receiver fails, the endpoint should be // considered contaminated and not used (though shutdown can and should // still be invoked). Stage(paths []string, digests [][]byte) ([]string, []*rsync.Signature, rsync.Receiver, error) // Supply transmits files in a streaming fashion using the rsync algorithm // to the specified receiver. Supply(paths []string, signatures []*rsync.Signature, receiver rsync.Receiver) error // Transition performs the specified transitions on the endpoint. It returns // a list of successfully applied changes and a list of problems that // occurred while applying transitions. // TODO: Should we consider pre-emptability for transition? It could // probably be done by just checking for cancellation during each transition // path and reporting "cancelled" for problems arising after that, but // usually the long-blocking transitions are going to be the ones where // we're creating the root with a huge number of files and wouldn't catch // cancellation until they're all done anyway. Transition(ctx context.Context, transitions []*core.Change) ([]*core.Entry, []*core.Problem, bool, error) // Shutdown terminates any resources associated with the endpoint. For local // endpoints, Shutdown will not preempt calls, but for remote endpoints it // will because it closes the underlying connection to the endpoint // (actually, it terminates that connection). Shutdown can safely be called // concurrently with other methods, though it's only recommended when you // don't want the possibility of preempting the method (e.g. in Transition) // or you know that the operation can continue and terminate on its own // (e.g. in Scan). Shutdown should only be invoked once. Shutdown() error }
Endpoint defines the interface to which synchronization endpoints must adhere for a single session. It provides all primitives necessary to support synchronization. None of its methods should be considered safe for concurrent invocation except Shutdown. If any method returns an error, the endpoint should be considered failed and no more of its methods (other than Shutdown) should be invoked.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides synchronization session management facilities. Its methods are safe for concurrent usage, so it can be easily exported via an RPC interface.
func NewManager ¶
NewManager creates a new Manager instance.
func (*Manager) Create ¶
func (m *Manager) Create( ctx context.Context, alpha, beta *url.URL, configuration, configurationAlpha, configurationBeta *Configuration, name string, labels map[string]string, paused bool, prompter string, ) (string, error)
Create tells the manager to create a new session.
func (*Manager) Flush ¶
func (m *Manager) Flush(ctx context.Context, selection *selection.Selection, prompter string, skipWait bool) error
Flush tells the manager to flush sessions matching the given specifications.
func (*Manager) List ¶
func (m *Manager) List(_ context.Context, selection *selection.Selection, previousStateIndex uint64) (uint64, []*State, error)
List requests a state snapshot for the specified sessions.
func (*Manager) Pause ¶
Pause tells the manager to pause sessions matching the given specifications.
func (*Manager) Reset ¶ added in v0.10.2
Reset tells the manager to reset session histories for sessions matching the given specifications.
func (*Manager) Resume ¶
func (m *Manager) Resume(ctx context.Context, selection *selection.Selection, prompter string) error
Resume tells the manager to resume sessions matching the given specifications.
type ProtocolHandler ¶
type ProtocolHandler interface { // Connect connects to an endpoint using the connection parameters in the // provided URL and the specified prompter (if any). It then initializes the // endpoint using the specified parameters. Connect( ctx context.Context, logger *logging.Logger, url *urlpkg.URL, prompter string, session string, version Version, configuration *Configuration, alpha bool, ) (Endpoint, error) }
ProtocolHandler defines the interface that protocol handlers must support in order to connect to endpoints.
type ScanMode ¶
type ScanMode int32
ScanMode specifies the mode for synchronization root scanning.
const ( // ScanMode_ScanModeDefault represents an unspecified scan mode. It should // be converted to one of the following values based on the desired default // behavior. ScanMode_ScanModeDefault ScanMode = 0 // ScanMode_ScanModeFull specifies that full scans should be performed on // each synchronization cycle. ScanMode_ScanModeFull ScanMode = 1 // ScanMode_ScanModeAccelerated specifies that scans should attempt to use // watch-based acceleration. ScanMode_ScanModeAccelerated ScanMode = 2 )
func (ScanMode) Description ¶
Description returns a human-readable description of a scan mode.
func (ScanMode) Descriptor ¶ added in v0.12.0
func (ScanMode) Descriptor() protoreflect.EnumDescriptor
func (ScanMode) EnumDescriptor
deprecated
func (ScanMode) IsDefault ¶
IsDefault indicates whether or not the scan mode is ScanMode_ScanModeDefault.
func (ScanMode) Number ¶ added in v0.12.0
func (x ScanMode) Number() protoreflect.EnumNumber
func (ScanMode) Supported ¶
Supported indicates whether or not a particular scan mode is a valid, non-default value.
func (ScanMode) Type ¶ added in v0.12.0
func (ScanMode) Type() protoreflect.EnumType
func (*ScanMode) UnmarshalText ¶
UnmarshalText implements the text unmarshalling interface used when loading from TOML files.
type Session ¶
type Session struct { // Identifier is the (unique) session identifier. It is static. It cannot be // empty. Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` // Version is the session version. It is static. Version Version `protobuf:"varint,2,opt,name=version,proto3,enum=synchronization.Version" json:"version,omitempty"` // CreationTime is the creation time of the session. It is static. It cannot // be nil. CreationTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=creationTime,proto3" json:"creationTime,omitempty"` // CreatingVersionMajor is the major version component of the version of // Mutagen which created the session. It is static. CreatingVersionMajor uint32 `protobuf:"varint,4,opt,name=creatingVersionMajor,proto3" json:"creatingVersionMajor,omitempty"` // CreatingVersionMinor is the minor version component of the version of // Mutagen which created the session. It is static. CreatingVersionMinor uint32 `protobuf:"varint,5,opt,name=creatingVersionMinor,proto3" json:"creatingVersionMinor,omitempty"` // CreatingVersionPatch is the patch version component of the version of // Mutagen which created the session. It is static. CreatingVersionPatch uint32 `protobuf:"varint,6,opt,name=creatingVersionPatch,proto3" json:"creatingVersionPatch,omitempty"` // Alpha is the alpha endpoint URL. It is static. It cannot be nil. Alpha *url.URL `protobuf:"bytes,7,opt,name=alpha,proto3" json:"alpha,omitempty"` // Beta is the beta endpoint URL. It is static. It cannot be nil. Beta *url.URL `protobuf:"bytes,8,opt,name=beta,proto3" json:"beta,omitempty"` // Configuration is the flattened session configuration. It is static. It // cannot be nil. Configuration *Configuration `protobuf:"bytes,9,opt,name=configuration,proto3" json:"configuration,omitempty"` // ConfigurationAlpha are the alpha-specific session configuration // overrides. It is static. It may be nil for existing sessions loaded from // disk, but it is not considered valid unless non-nil, so it should be // replaced with an empty default value in-memory if a nil on-disk value is // detected. ConfigurationAlpha *Configuration `protobuf:"bytes,11,opt,name=configurationAlpha,proto3" json:"configurationAlpha,omitempty"` // ConfigurationBeta are the beta-specific session configuration overrides. // It is static. It may be nil for existing sessions loaded from disk, but // it is not considered valid unless non-nil, so it should be replaced with // an empty default value in-memory if a nil on-disk value is detected. ConfigurationBeta *Configuration `protobuf:"bytes,12,opt,name=configurationBeta,proto3" json:"configurationBeta,omitempty"` // Name is a user-friendly name for the session. It may be empty and is not // guaranteed to be unique across all sessions. It is only used as a simpler // handle for specifying sessions. It is static. Name string `protobuf:"bytes,14,opt,name=name,proto3" json:"name,omitempty"` // Labels are the session labels. They are static. Labels map[string]string `` /* 154-byte string literal not displayed */ // Paused indicates whether or not the session is marked as paused. Paused bool `protobuf:"varint,10,opt,name=paused,proto3" json:"paused,omitempty"` // contains filtered or unexported fields }
func (*Session) Descriptor
deprecated
func (*Session) EnsureValid ¶
EnsureValid ensures that Session's invariants are respected.
func (*Session) GetConfiguration ¶
func (x *Session) GetConfiguration() *Configuration
func (*Session) GetConfigurationAlpha ¶
func (x *Session) GetConfigurationAlpha() *Configuration
func (*Session) GetConfigurationBeta ¶
func (x *Session) GetConfigurationBeta() *Configuration
func (*Session) GetCreatingVersionMajor ¶
func (*Session) GetCreatingVersionMinor ¶
func (*Session) GetCreatingVersionPatch ¶
func (*Session) GetCreationTime ¶
func (*Session) GetIdentifier ¶
func (*Session) GetVersion ¶
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (*Session) ProtoReflect ¶ added in v0.12.0
func (x *Session) ProtoReflect() protoreflect.Message
type StageMode ¶
type StageMode int32
StageMode specifies the mode for file staging.
const ( // StageMode_StageModeDefault represents an unspecified staging mode. It // should be converted to one of the following values based on the desired // default behavior. StageMode_StageModeDefault StageMode = 0 // StageMode_StageModeMutagen specifies that files should be staged in the // Mutagen data directory. StageMode_StageModeMutagen StageMode = 1 // StageMode_StageModeNeighboring specifies that files should be staged in a // directory which neighbors the synchronization root. StageMode_StageModeNeighboring StageMode = 2 )
func (StageMode) Description ¶
Description returns a human-readable description of a staging mode.
func (StageMode) Descriptor ¶ added in v0.12.0
func (StageMode) Descriptor() protoreflect.EnumDescriptor
func (StageMode) EnumDescriptor
deprecated
func (StageMode) IsDefault ¶
IsDefault indicates whether or not the staging mode is StageMode_StageModeDefault.
func (StageMode) Number ¶ added in v0.12.0
func (x StageMode) Number() protoreflect.EnumNumber
func (StageMode) Supported ¶
Supported indicates whether or not a particular staging mode is a valid, non-default value.
func (StageMode) Type ¶ added in v0.12.0
func (StageMode) Type() protoreflect.EnumType
func (*StageMode) UnmarshalText ¶
UnmarshalText implements the text unmarshalling interface used when loading from TOML files.
type State ¶
type State struct { Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"` Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=synchronization.Status" json:"status,omitempty"` AlphaConnected bool `protobuf:"varint,3,opt,name=alphaConnected,proto3" json:"alphaConnected,omitempty"` BetaConnected bool `protobuf:"varint,4,opt,name=betaConnected,proto3" json:"betaConnected,omitempty"` LastError string `protobuf:"bytes,5,opt,name=lastError,proto3" json:"lastError,omitempty"` SuccessfulSynchronizationCycles uint64 `protobuf:"varint,6,opt,name=successfulSynchronizationCycles,proto3" json:"successfulSynchronizationCycles,omitempty"` StagingStatus *rsync.ReceiverStatus `protobuf:"bytes,7,opt,name=stagingStatus,proto3" json:"stagingStatus,omitempty"` Conflicts []*core.Conflict `protobuf:"bytes,8,rep,name=conflicts,proto3" json:"conflicts,omitempty"` AlphaProblems []*core.Problem `protobuf:"bytes,9,rep,name=alphaProblems,proto3" json:"alphaProblems,omitempty"` BetaProblems []*core.Problem `protobuf:"bytes,10,rep,name=betaProblems,proto3" json:"betaProblems,omitempty"` TruncatedConflicts uint64 `protobuf:"varint,11,opt,name=truncatedConflicts,proto3" json:"truncatedConflicts,omitempty"` TruncatedAlphaProblems uint64 `protobuf:"varint,12,opt,name=truncatedAlphaProblems,proto3" json:"truncatedAlphaProblems,omitempty"` TruncatedBetaProblems uint64 `protobuf:"varint,13,opt,name=truncatedBetaProblems,proto3" json:"truncatedBetaProblems,omitempty"` // contains filtered or unexported fields }
func (*State) Copy ¶
Copy creates a copy of the session state, deep-copying those members which are mutable.
func (*State) Descriptor
deprecated
func (*State) EnsureValid ¶
EnsureValid ensures that State's invariants are respected.
func (*State) GetAlphaConnected ¶
func (*State) GetAlphaProblems ¶
func (*State) GetBetaConnected ¶
func (*State) GetBetaProblems ¶
func (*State) GetConflicts ¶
func (*State) GetLastError ¶
func (*State) GetSession ¶
func (*State) GetStagingStatus ¶
func (x *State) GetStagingStatus() *rsync.ReceiverStatus
func (*State) GetSuccessfulSynchronizationCycles ¶
func (*State) GetTruncatedAlphaProblems ¶
func (*State) GetTruncatedBetaProblems ¶
func (*State) GetTruncatedConflicts ¶
func (*State) ProtoMessage ¶
func (*State) ProtoMessage()
func (*State) ProtoReflect ¶ added in v0.12.0
func (x *State) ProtoReflect() protoreflect.Message
type Status ¶
type Status int32
const ( Status_Disconnected Status = 0 Status_HaltedOnRootEmptied Status = 1 Status_HaltedOnRootDeletion Status = 2 Status_HaltedOnRootTypeChange Status = 3 Status_ConnectingAlpha Status = 4 Status_ConnectingBeta Status = 5 Status_Watching Status = 6 Status_Scanning Status = 7 Status_WaitingForRescan Status = 8 Status_Reconciling Status = 9 Status_StagingAlpha Status = 10 Status_StagingBeta Status = 11 Status_Transitioning Status = 12 Status_Saving Status = 13 )
func (Status) Description ¶
Description returns a human-readable description of the session status.
func (Status) Descriptor ¶ added in v0.12.0
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶ added in v0.12.0
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶ added in v0.12.0
func (Status) Type() protoreflect.EnumType
type Version ¶
type Version int32
Version specifies a session version, providing default behavior that can vary without affecting existing sessions.
func (Version) DefaultDirectoryMode ¶
func (v Version) DefaultDirectoryMode() filesystem.Mode
DefaultDirectoryMode returns the default directory permission mode for the session version.
func (Version) DefaultFileMode ¶
func (v Version) DefaultFileMode() filesystem.Mode
DefaultFileMode returns the default file permission mode for the session version.
func (Version) DefaultGroupSpecification ¶
DefaultGroupSpecification returns the default owner group specification for the session version.
func (Version) DefaultIgnoreVCSMode ¶
func (v Version) DefaultIgnoreVCSMode() core.IgnoreVCSMode
DefaultIgnoreVCSMode returns the default VCS ignore mode for the session version.
func (Version) DefaultMaximumEntryCount ¶
DefaultMaximumEntryCount returns the default maximum entry count for the session version.
func (Version) DefaultMaximumStagingFileSize ¶
DefaultMaximumStagingFileSize returns the default maximum staging file size for the session version.
func (Version) DefaultOwnerSpecification ¶
DefaultOwnerSpecification returns the default owner specification for the session version.
func (Version) DefaultProbeMode ¶
DefaultProbeMode returns the default probe mode for the session version.
func (Version) DefaultScanMode ¶
DefaultScanMode returns the default scan mode for the session version.
func (Version) DefaultStageMode ¶
DefaultStageMode returns the default staging mode for the session version.
func (Version) DefaultSymlinkMode ¶
func (v Version) DefaultSymlinkMode() core.SymlinkMode
DefaultSymlinkMode returns the default symlink mode for the session version.
func (Version) DefaultSynchronizationMode ¶
func (v Version) DefaultSynchronizationMode() core.SynchronizationMode
DefaultSynchronizationMode returns the default synchronization mode for the session version.
func (Version) DefaultWatchMode ¶
DefaultWatchMode returns the default watch mode for the session version.
func (Version) DefaultWatchPollingInterval ¶
DefaultWatchPollingInterval returns the default watch polling interval for the session version.
func (Version) Descriptor ¶ added in v0.12.0
func (Version) Descriptor() protoreflect.EnumDescriptor
func (Version) EnumDescriptor
deprecated
func (Version) Number ¶ added in v0.12.0
func (x Version) Number() protoreflect.EnumNumber
func (Version) Type ¶ added in v0.12.0
func (Version) Type() protoreflect.EnumType
type WatchMode ¶
type WatchMode int32
WatchMode specifies the mode for filesystem watching.
const ( // WatchMode_WatchModeDefault represents an unspecified watch mode. It // should be converted to one of the following values based on the desired // default behavior. WatchMode_WatchModeDefault WatchMode = 0 // WatchMode_WatchModePortable specifies that native recursive watching // should be used to monitor paths on systems that support it if those paths // fall under the home directory. In these cases, a watch on the entire home // directory is established and filtered for events pertaining to the // specified path. On all other systems and for all other paths, poll-based // watching is used. WatchMode_WatchModePortable WatchMode = 1 // WatchMode_WatchModeForcePoll specifies that only poll-based watching // should be used. WatchMode_WatchModeForcePoll WatchMode = 2 // WatchMode_WatchModeNoWatch specifies that no watching should be used // (i.e. no events should be generated). WatchMode_WatchModeNoWatch WatchMode = 3 )
func (WatchMode) Description ¶
Description returns a human-readable description of a watch mode.
func (WatchMode) Descriptor ¶ added in v0.12.0
func (WatchMode) Descriptor() protoreflect.EnumDescriptor
func (WatchMode) EnumDescriptor
deprecated
func (WatchMode) IsDefault ¶
IsDefault indicates whether or not the watch mode is WatchMode_WatchModeDefault.
func (WatchMode) Number ¶ added in v0.12.0
func (x WatchMode) Number() protoreflect.EnumNumber
func (WatchMode) Supported ¶
Supported indicates whether or not a particular watch mode is a valid, non-default value.
func (WatchMode) Type ¶ added in v0.12.0
func (WatchMode) Type() protoreflect.EnumType
func (*WatchMode) UnmarshalText ¶
UnmarshalText implements the text unmarshalling interface used when loading from TOML files.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package sync provides the core data structures and algorithms used by Mutagen.
|
Package sync provides the core data structures and algorithms used by Mutagen. |
Package endpoint provides synchronization endpoint implementations.
|
Package endpoint provides synchronization endpoint implementations. |
local
Package local provides a local synchronization endpoint implementation.
|
Package local provides a local synchronization endpoint implementation. |
remote
Package remote provides a client/server architecture for connecting to and hosting a remote synchronization endpoint.
|
Package remote provides a client/server architecture for connecting to and hosting a remote synchronization endpoint. |
Package protocols provides synchronization session protocol handler implementations.
|
Package protocols provides synchronization session protocol handler implementations. |
docker
Package docker provides the Docker synchronization session protocol implementation.
|
Package docker provides the Docker synchronization session protocol implementation. |
local
Package local provides the local synchronization session protocol implementation.
|
Package local provides the local synchronization session protocol implementation. |
ssh
Package ssh provides the SSH synchronization session protocol implementation.
|
Package ssh provides the SSH synchronization session protocol implementation. |
tunnel
Package tunnel provides a tunnel-based synchronization protocol implementation.
|
Package tunnel provides a tunnel-based synchronization protocol implementation. |
Package rsync provides an implementation of the rsync algorithm as described in Andrew Tridgell's thesis (https://www.samba.org/~tridge/phd_thesis.pdf) and the rsync technical report (https://rsync.samba.org/tech_report).
|
Package rsync provides an implementation of the rsync algorithm as described in Andrew Tridgell's thesis (https://www.samba.org/~tridge/phd_thesis.pdf) and the rsync technical report (https://rsync.samba.org/tech_report). |