legacy

package
v0.11.8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package legacy provides the infrastructure for loading legacy TOML-based synchronization session configurations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigurationPath

func ConfigurationPath() (string, error)

ConfigurationPath returns the path of the legacy TOML-based global synchronization configuration file. It does not verify that the file exists.

Types

type Configuration

type Configuration struct {
	// Synchronization contains parameters related to synchronization behavior.
	Synchronization struct {
		// Mode specifies the default synchronization mode.
		Mode core.SynchronizationMode `toml:"mode"`
		// MaximumEntryCount specifies the maximum number of filesystem entries
		// that endpoints will tolerate managing.
		MaximumEntryCount uint64 `toml:"maxEntryCount"`
		// MaximumStagingFileSize is the maximum (individual) file size that
		// endpoints will stage. It can be specified in human-friendly units.
		MaximumStagingFileSize types.ByteSize `toml:"maxStagingFileSize"`
		// ProbeMode specifies the filesystem probing mode.
		ProbeMode behavior.ProbeMode `toml:"probeMode"`
		// ScanMode specifies the filesystem scanning mode.
		ScanMode synchronization.ScanMode `toml:"scanMode"`
		// StageMode specifies the filesystem staging mode.
		StageMode synchronization.StageMode `toml:"stageMode"`
	} `toml:"sync"`
	// Ignore contains parameters related to synchronization ignore
	// specifications.
	Ignore struct {
		// Default specifies the default list of ignore specifications.
		Default []string `toml:"default"`
		// VCS specifies the VCS ignore mode.
		VCS core.IgnoreVCSMode `toml:"vcs"`
	} `toml:"ignore"`
	// Symlink contains parameters related to symlink handling.
	Symlink struct {
		// Mode specifies the symlink mode.
		Mode core.SymlinkMode `toml:"mode"`
	} `toml:"symlink"`
	// Watch contains parameters related to filesystem monitoring.
	Watch struct {
		// Mode specifies the file watching mode.
		Mode synchronization.WatchMode `toml:"mode"`
		// PollingInterval specifies the interval (in seconds) for poll-based
		// file monitoring. A value of 0 specifies that Mutagen's internal
		// default interval should be used.
		PollingInterval uint32 `toml:"pollingInterval"`
	} `toml:"watch"`
	// Permissions contains parameters related to permission handling.
	Permissions struct {
		// DefaultFileMode specifies the default permission mode to use for new
		// files in "portable" permission propagation mode.
		DefaultFileMode filesystem.Mode `toml:"defaultFileMode"`
		// DefaultDirectoryMode specifies the default permission mode to use for
		// new files in "portable" permission propagation mode.
		DefaultDirectoryMode filesystem.Mode `toml:"defaultDirectoryMode"`
		// DefaultOwner specifies the default owner identifier to use when
		// setting ownership of new files and directories in "portable"
		// permission propagation mode.
		DefaultOwner string `toml:"defaultOwner"`
		// DefaultGroup specifies the default group identifier to use when
		// setting ownership of new files and directories in "portable"
		// permission propagation mode.
		DefaultGroup string `toml:"defaultGroup"`
	} `toml:"permissions"`
}

Configuration is the legacy TOML-based Mutagen session configuration format.

func LoadConfiguration

func LoadConfiguration(path string) (*Configuration, error)

LoadConfiguration attempts to load a legacy TOML-based Mutagen synchronization configuration file from the specified path.

func (*Configuration) Configuration

func (c *Configuration) Configuration() *synchronization.Configuration

Configuration converts a legacy TOML-based session configuration to a Protocol Buffers session configuration. It does not validate the resulting configuration.

Jump to

Keyboard shortcuts

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