config

package
v1.11.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MPL-2.0 Imports: 36 Imported by: 33

Documentation

Overview

Package config implements reading and writing of the syncthing configuration file.

Index

Constants

View Source
const (
	OldestHandledVersion = 10
	CurrentVersion       = 32
	MaxRescanIntervalS   = 365 * 24 * 60 * 60
)
View Source
const DefaultMarkerName = ".stfolder"

Variables

View Source
var (
	// DefaultTCPPort defines default TCP port used if the URI does not specify one, for example tcp://0.0.0.0
	DefaultTCPPort = 22000
	// DefaultQUICPort defines default QUIC port used if the URI does not specify one, for example quic://0.0.0.0
	DefaultQUICPort = 22000
	// DefaultListenAddresses should be substituted when the configuration
	// contains <listenAddress>default</listenAddress>. This is done by the
	// "consumer" of the configuration as we don't want these saved to the
	// config.
	DefaultListenAddresses = []string{
		util.Address("tcp", net.JoinHostPort("0.0.0.0", strconv.Itoa(DefaultTCPPort))),
		"dynamic+https://relays.syncthing.net/endpoint",
		util.Address("quic", net.JoinHostPort("0.0.0.0", strconv.Itoa(DefaultQUICPort))),
	}
	DefaultGUIPort = 8384
	// DefaultDiscoveryServersV4 should be substituted when the configuration
	// contains <globalAnnounceServer>default-v4</globalAnnounceServer>.
	DefaultDiscoveryServersV4 = []string{
		"https://discovery.syncthing.net/v2/?noannounce&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW",
		"https://discovery-v4.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW",
	}
	// DefaultDiscoveryServersV6 should be substituted when the configuration
	// contains <globalAnnounceServer>default-v6</globalAnnounceServer>.
	DefaultDiscoveryServersV6 = []string{
		"https://discovery.syncthing.net/v2/?noannounce&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW",
		"https://discovery-v6.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW",
	}
	// DefaultDiscoveryServers should be substituted when the configuration
	// contains <globalAnnounceServer>default</globalAnnounceServer>.
	DefaultDiscoveryServers = append(DefaultDiscoveryServersV4, DefaultDiscoveryServersV6...)
	// DefaultTheme is the default and fallback theme for the web UI.
	DefaultTheme = "default"

	// DefaultPrimaryStunServers are servers provided by us (to avoid causing the public servers burden)
	DefaultPrimaryStunServers = []string{
		"stun.syncthing.net:3478",
	}
	DefaultSecondaryStunServers = []string{
		"stun.callwithus.com:3478",
		"stun.counterpath.com:3478",
		"stun.counterpath.net:3478",
		"stun.ekiga.net:3478",
		"stun.ideasip.com:3478",
		"stun.internetcalls.com:3478",
		"stun.schlund.de:3478",
		"stun.sipgate.net:10000",
		"stun.sipgate.net:3478",
		"stun.voip.aebc.com:3478",
		"stun.voiparound.com:3478",
		"stun.voipbuster.com:3478",
		"stun.voipstunt.com:3478",
		"stun.xten.com:3478",
	}
)
View Source
var (
	ErrInvalidLengthConfig        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowConfig          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupConfig = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthDeviceconfiguration        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDeviceconfiguration          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupDeviceconfiguration = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrPathNotDirectory = errors.New("folder path not a directory")
	ErrPathMissing      = errors.New("folder path missing")
	ErrMarkerMissing    = errors.New("folder marker missing (this indicates potential data loss, search docs/forum to get information about how to proceed)")
)
View Source
var (
	ErrInvalidLengthFolderconfiguration        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowFolderconfiguration          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupFolderconfiguration = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthGuiconfiguration        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGuiconfiguration          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGuiconfiguration = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthLdapconfiguration        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLdapconfiguration          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupLdapconfiguration = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthObserved        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowObserved          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupObserved = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthOptionsconfiguration        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowOptionsconfiguration          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupOptionsconfiguration = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthSize        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSize          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSize = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthVersioningconfiguration        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowVersioningconfiguration          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupVersioningconfiguration = fmt.Errorf("proto: unexpected end of group")
)
View Source
var AuthMode_name = map[int32]string{
	0: "AUTH_MODE_STATIC",
	1: "AUTH_MODE_LDAP",
}
View Source
var AuthMode_value = map[string]int32{
	"AUTH_MODE_STATIC": 0,
	"AUTH_MODE_LDAP":   1,
}
View Source
var BlockPullOrder_name = map[int32]string{
	0: "BLOCK_PULL_ORDER_STANDARD",
	1: "BLOCK_PULL_ORDER_RANDOM",
	2: "BLOCK_PULL_ORDER_IN_ORDER",
}
View Source
var BlockPullOrder_value = map[string]int32{
	"BLOCK_PULL_ORDER_STANDARD": 0,
	"BLOCK_PULL_ORDER_RANDOM":   1,
	"BLOCK_PULL_ORDER_IN_ORDER": 2,
}
View Source
var FolderType_name = map[int32]string{
	0: "FOLDER_TYPE_SEND_RECEIVE",
	1: "FOLDER_TYPE_SEND_ONLY",
	2: "FOLDER_TYPE_RECEIVE_ONLY",
}
View Source
var FolderType_value = map[string]int32{
	"FOLDER_TYPE_SEND_RECEIVE": 0,
	"FOLDER_TYPE_SEND_ONLY":    1,
	"FOLDER_TYPE_RECEIVE_ONLY": 2,
}
View Source
var LDAPTransport_name = map[int32]string{
	0: "LDAP_TRANSPORT_PLAIN",
	2: "LDAP_TRANSPORT_TLS",
	3: "LDAP_TRANSPORT_START_TLS",
}
View Source
var LDAPTransport_value = map[string]int32{
	"LDAP_TRANSPORT_PLAIN":     0,
	"LDAP_TRANSPORT_TLS":       2,
	"LDAP_TRANSPORT_START_TLS": 3,
}
View Source
var PullOrder_name = map[int32]string{
	0: "PULL_ORDER_RANDOM",
	1: "PULL_ORDER_ALPHABETIC",
	2: "PULL_ORDER_SMALLEST_FIRST",
	3: "PULL_ORDER_LARGEST_FIRST",
	4: "PULL_ORDER_OLDEST_FIRST",
	5: "PULL_ORDER_NEWEST_FIRST",
}
View Source
var PullOrder_value = map[string]int32{
	"PULL_ORDER_RANDOM":         0,
	"PULL_ORDER_ALPHABETIC":     1,
	"PULL_ORDER_SMALLEST_FIRST": 2,
	"PULL_ORDER_LARGEST_FIRST":  3,
	"PULL_ORDER_OLDEST_FIRST":   4,
	"PULL_ORDER_NEWEST_FIRST":   5,
}
View Source
var Tuning_name = map[int32]string{
	0: "TUNING_AUTO",
	1: "TUNING_SMALL",
	2: "TUNING_LARGE",
}
View Source
var Tuning_value = map[string]int32{
	"TUNING_AUTO":  0,
	"TUNING_SMALL": 1,
	"TUNING_LARGE": 2,
}

Functions

func CheckFreeSpace added in v1.1.0

func CheckFreeSpace(minFree Size, usage fs.Usage) error

CheckFreeSpace checks that the free space does not fall below the minimum required free space.

Types

type AuthMode added in v0.14.51

type AuthMode int32
const (
	AuthModeStatic AuthMode = 0
	AuthModeLDAP   AuthMode = 1
)

func (AuthMode) EnumDescriptor added in v1.10.0

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

func (AuthMode) MarshalText added in v0.14.51

func (t AuthMode) MarshalText() ([]byte, error)

func (AuthMode) String added in v0.14.51

func (t AuthMode) String() string

func (*AuthMode) UnmarshalText added in v0.14.51

func (t *AuthMode) UnmarshalText(bs []byte) error

type BlockPullOrder added in v1.6.0

type BlockPullOrder int32
const (
	BlockPullOrderStandard BlockPullOrder = 0
	BlockPullOrderRandom   BlockPullOrder = 1
	BlockPullOrderInOrder  BlockPullOrder = 2
)

func (BlockPullOrder) EnumDescriptor added in v1.10.0

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

func (BlockPullOrder) MarshalText added in v1.6.0

func (o BlockPullOrder) MarshalText() ([]byte, error)

func (BlockPullOrder) String added in v1.6.0

func (o BlockPullOrder) String() string

func (*BlockPullOrder) UnmarshalText added in v1.6.0

func (o *BlockPullOrder) UnmarshalText(bs []byte) error

type Committer

type Committer interface {
	VerifyConfiguration(from, to Configuration) error
	CommitConfiguration(from, to Configuration) (handled bool)
	String() string
}

The Committer interface is implemented by objects that need to know about or have a say in configuration changes.

When the configuration is about to be changed, VerifyConfiguration() is called for each subscribing object, with the old and new configuration. A nil error is returned if the new configuration is acceptable (i.e. does not contain any errors that would prevent it from being a valid config). Otherwise an error describing the problem is returned.

If any subscriber returns an error from VerifyConfiguration(), the configuration change is not committed and an error is returned to whoever tried to commit the broken config.

If all verification calls returns nil, CommitConfiguration() is called for each subscribing object. The callee returns true if the new configuration has been successfully applied, otherwise false. Any Commit() call returning false will result in a "restart needed" response to the API/user. Note that the new configuration will still have been applied by those who were capable of doing so.

type Configuration

type Configuration struct {
	Version        int                   `protobuf:"varint,1,opt,name=version,proto3,casttype=int" json:"version" xml:"version,attr"`
	Folders        []FolderConfiguration `protobuf:"bytes,2,rep,name=folders,proto3" json:"folders" xml:"folder"`
	Devices        []DeviceConfiguration `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices" xml:"device"`
	GUI            GUIConfiguration      `protobuf:"bytes,4,opt,name=gui,proto3" json:"gui" xml:"gui"`
	LDAP           LDAPConfiguration     `protobuf:"bytes,5,opt,name=ldap,proto3" json:"ldap" xml:"ldap"`
	Options        OptionsConfiguration  `protobuf:"bytes,6,opt,name=options,proto3" json:"options" xml:"options"`
	IgnoredDevices []ObservedDevice      `protobuf:"bytes,7,rep,name=ignored_devices,json=ignoredDevices,proto3" json:"remoteIgnoredDevices" xml:"remoteIgnoredDevice"`
	PendingDevices []ObservedDevice      `protobuf:"bytes,8,rep,name=pending_devices,json=pendingDevices,proto3" json:"pendingDevices" xml:"pendingDevice"`
}

func New

func NewWithFreePorts added in v1.1.0

func NewWithFreePorts(myID protocol.DeviceID) (Configuration, error)

func ReadJSON added in v0.12.0

func ReadJSON(r io.Reader, myID protocol.DeviceID) (Configuration, error)

func ReadXML

func ReadXML(r io.Reader, myID protocol.DeviceID) (Configuration, int, error)

func (Configuration) Copy

func (cfg Configuration) Copy() Configuration

func (*Configuration) Descriptor added in v1.10.0

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

func (*Configuration) DeviceMap added in v0.14.47

func (cfg *Configuration) DeviceMap() map[protocol.DeviceID]DeviceConfiguration

DeviceMap returns a map of device ID to device configuration for the given configuration.

func (*Configuration) Marshal added in v1.11.0

func (m *Configuration) Marshal() (dAtA []byte, err error)

func (*Configuration) MarshalTo added in v1.11.0

func (m *Configuration) MarshalTo(dAtA []byte) (int, error)

func (*Configuration) MarshalToSizedBuffer added in v1.11.0

func (m *Configuration) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Configuration) ProtoMessage added in v1.10.0

func (*Configuration) ProtoMessage()

func (*Configuration) ProtoSize added in v1.10.0

func (m *Configuration) ProtoSize() (n int)

func (*Configuration) Reset added in v1.10.0

func (m *Configuration) Reset()

func (*Configuration) String added in v1.10.0

func (m *Configuration) String() string

func (*Configuration) Unmarshal added in v1.11.0

func (m *Configuration) Unmarshal(dAtA []byte) error

func (*Configuration) WriteXML

func (cfg *Configuration) WriteXML(w io.Writer) error

func (*Configuration) XXX_DiscardUnknown added in v1.10.0

func (m *Configuration) XXX_DiscardUnknown()

func (*Configuration) XXX_Marshal added in v1.10.0

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

func (*Configuration) XXX_Merge added in v1.10.0

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

func (*Configuration) XXX_Size added in v1.10.0

func (m *Configuration) XXX_Size() int

func (*Configuration) XXX_Unmarshal added in v1.10.0

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

type DeviceConfiguration

type DeviceConfiguration struct {
	DeviceID                 github_com_syncthing_syncthing_lib_protocol.DeviceID `` /* 152-byte string literal not displayed */
	Name                     string                                               `protobuf:"bytes,2,opt,name=name,proto3" json:"name" xml:"name,attr,omitempty"`
	Addresses                []string                                             `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses" xml:"address,omitempty" default:"dynamic"`
	Compression              protocol.Compression                                 `protobuf:"varint,4,opt,name=compression,proto3,enum=protocol.Compression" json:"compression" xml:"compression,attr"`
	CertName                 string                                               `protobuf:"bytes,5,opt,name=cert_name,json=certName,proto3" json:"certName" xml:"certName,attr,omitempty"`
	Introducer               bool                                                 `protobuf:"varint,6,opt,name=introducer,proto3" json:"introducer" xml:"introducer,attr"`
	SkipIntroductionRemovals bool                                                 `` /* 160-byte string literal not displayed */
	IntroducedBy             github_com_syncthing_syncthing_lib_protocol.DeviceID `` /* 174-byte string literal not displayed */
	Paused                   bool                                                 `protobuf:"varint,9,opt,name=paused,proto3" json:"paused" xml:"paused"`
	AllowedNetworks          []string                                             `` /* 127-byte string literal not displayed */
	AutoAcceptFolders        bool                                                 `` /* 128-byte string literal not displayed */
	MaxSendKbps              int                                                  `protobuf:"varint,12,opt,name=max_send_kbps,json=maxSendKbps,proto3,casttype=int" json:"maxSendKbps" xml:"maxSendKbps"`
	MaxRecvKbps              int                                                  `protobuf:"varint,13,opt,name=max_recv_kbps,json=maxRecvKbps,proto3,casttype=int" json:"maxRecvKbps" xml:"maxRecvKbps"`
	IgnoredFolders           []ObservedFolder                                     `protobuf:"bytes,14,rep,name=ignored_folders,json=ignoredFolders,proto3" json:"ignoredFolders" xml:"ignoredFolder"`
	PendingFolders           []ObservedFolder                                     `protobuf:"bytes,15,rep,name=pending_folders,json=pendingFolders,proto3" json:"pendingFolders" xml:"pendingFolder"`
	MaxRequestKiB            int                                                  `protobuf:"varint,16,opt,name=max_request_kib,json=maxRequestKib,proto3,casttype=int" json:"maxRequestKiB" xml:"maxRequestKiB"`
}

func NewDeviceConfiguration added in v0.12.2

func NewDeviceConfiguration(id protocol.DeviceID, name string) DeviceConfiguration

func (DeviceConfiguration) Copy

func (*DeviceConfiguration) Descriptor added in v1.10.0

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

func (*DeviceConfiguration) IgnoredFolder added in v0.14.51

func (cfg *DeviceConfiguration) IgnoredFolder(folder string) bool

func (*DeviceConfiguration) Marshal added in v1.11.0

func (m *DeviceConfiguration) Marshal() (dAtA []byte, err error)

func (*DeviceConfiguration) MarshalTo added in v1.11.0

func (m *DeviceConfiguration) MarshalTo(dAtA []byte) (int, error)

func (*DeviceConfiguration) MarshalToSizedBuffer added in v1.11.0

func (m *DeviceConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DeviceConfiguration) ProtoMessage added in v1.10.0

func (*DeviceConfiguration) ProtoMessage()

func (*DeviceConfiguration) ProtoSize added in v1.10.0

func (m *DeviceConfiguration) ProtoSize() (n int)

func (*DeviceConfiguration) Reset added in v1.10.0

func (m *DeviceConfiguration) Reset()

func (*DeviceConfiguration) String added in v1.10.0

func (m *DeviceConfiguration) String() string

func (*DeviceConfiguration) Unmarshal added in v1.11.0

func (m *DeviceConfiguration) Unmarshal(dAtA []byte) error

func (*DeviceConfiguration) XXX_DiscardUnknown added in v1.10.0

func (m *DeviceConfiguration) XXX_DiscardUnknown()

func (*DeviceConfiguration) XXX_Marshal added in v1.10.0

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

func (*DeviceConfiguration) XXX_Merge added in v1.10.0

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

func (*DeviceConfiguration) XXX_Size added in v1.10.0

func (m *DeviceConfiguration) XXX_Size() int

func (*DeviceConfiguration) XXX_Unmarshal added in v1.10.0

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

type FolderConfiguration

type FolderConfiguration struct {
	ID                      string                      `protobuf:"bytes,1,opt,name=id,proto3" json:"id" xml:"id,attr"`
	Label                   string                      `protobuf:"bytes,2,opt,name=label,proto3" json:"label" xml:"label,attr" restart:"false"`
	FilesystemType          fs.FilesystemType           `` /* 137-byte string literal not displayed */
	Path                    string                      `protobuf:"bytes,4,opt,name=path,proto3" json:"path" xml:"path,attr"`
	Type                    FolderType                  `protobuf:"varint,5,opt,name=type,proto3,enum=config.FolderType" json:"type" xml:"type,attr"`
	Devices                 []FolderDeviceConfiguration `protobuf:"bytes,6,rep,name=devices,proto3" json:"devices" xml:"device"`
	RescanIntervalS         int                         `` /* 152-byte string literal not displayed */
	FSWatcherEnabled        bool                        `` /* 143-byte string literal not displayed */
	FSWatcherDelayS         int                         `` /* 151-byte string literal not displayed */
	IgnorePerms             bool                        `protobuf:"varint,10,opt,name=ignore_perms,json=ignorePerms,proto3" json:"ignorePerms" xml:"ignorePerms,attr"`
	AutoNormalize           bool                        `` /* 131-byte string literal not displayed */
	MinDiskFree             Size                        `protobuf:"bytes,12,opt,name=min_disk_free,json=minDiskFree,proto3" json:"minDiskFree" xml:"minDiskFree"`
	Versioning              VersioningConfiguration     `protobuf:"bytes,13,opt,name=versioning,proto3" json:"versioning" xml:"versioning"`
	Copiers                 int                         `protobuf:"varint,14,opt,name=copiers,proto3,casttype=int" json:"copiers" xml:"copiers"`
	PullerMaxPendingKiB     int                         `` /* 150-byte string literal not displayed */
	Hashers                 int                         `protobuf:"varint,16,opt,name=hashers,proto3,casttype=int" json:"hashers" xml:"hashers"`
	Order                   PullOrder                   `protobuf:"varint,17,opt,name=order,proto3,enum=config.PullOrder" json:"order" xml:"order"`
	IgnoreDelete            bool                        `protobuf:"varint,18,opt,name=ignore_delete,json=ignoreDelete,proto3" json:"ignoreDelete" xml:"ignoreDelete"`
	ScanProgressIntervalS   int                         `` /* 158-byte string literal not displayed */
	PullerPauseS            int                         `protobuf:"varint,20,opt,name=puller_pause_s,json=pullerPauseS,proto3,casttype=int" json:"pullerPauseS" xml:"pullerPauseS"`
	MaxConflicts            int                         `` /* 133-byte string literal not displayed */
	DisableSparseFiles      bool                        `` /* 132-byte string literal not displayed */
	DisableTempIndexes      bool                        `` /* 132-byte string literal not displayed */
	Paused                  bool                        `protobuf:"varint,24,opt,name=paused,proto3" json:"paused" xml:"paused"`
	WeakHashThresholdPct    int                         `` /* 154-byte string literal not displayed */
	MarkerName              string                      `protobuf:"bytes,26,opt,name=marker_name,json=markerName,proto3" json:"markerName" xml:"markerName"`
	CopyOwnershipFromParent bool                        `` /* 153-byte string literal not displayed */
	RawModTimeWindowS       int                         `` /* 130-byte string literal not displayed */
	MaxConcurrentWrites     int                         `` /* 161-byte string literal not displayed */
	DisableFsync            bool                        `protobuf:"varint,30,opt,name=disable_fsync,json=disableFsync,proto3" json:"disableFsync" xml:"disableFsync"`
	BlockPullOrder          BlockPullOrder              `` /* 143-byte string literal not displayed */
	CopyRangeMethod         fs.CopyRangeMethod          `` /* 163-byte string literal not displayed */
	CaseSensitiveFS         bool                        `protobuf:"varint,33,opt,name=case_sensitive_fs,json=caseSensitiveFs,proto3" json:"caseSensitiveFS" xml:"caseSensitiveFS"`
	JunctionsAsDirs         bool                        `protobuf:"varint,34,opt,name=follow_junctions,json=followJunctions,proto3" json:"junctionsAsDirs" xml:"junctionsAsDirs"`
	// Legacy deprecated
	DeprecatedReadOnly       bool    `protobuf:"varint,9000,opt,name=read_only,json=readOnly,proto3" json:"-" xml:"ro,attr,omitempty"`                       // Deprecated: Do not use.
	DeprecatedMinDiskFreePct float64 `protobuf:"fixed64,9001,opt,name=min_disk_free_pct,json=minDiskFreePct,proto3" json:"-" xml:"minDiskFreePct,omitempty"` // Deprecated: Do not use.
	DeprecatedPullers        int     `protobuf:"varint,9002,opt,name=pullers,proto3,casttype=int" json:"-" xml:"pullers,omitempty"`                          // Deprecated: Do not use.
}

func NewFolderConfiguration added in v0.12.2

func NewFolderConfiguration(myID protocol.DeviceID, id, label string, fsType fs.FilesystemType, path string) FolderConfiguration

func (*FolderConfiguration) CheckAvailableSpace added in v0.14.51

func (f *FolderConfiguration) CheckAvailableSpace(req uint64) error

func (*FolderConfiguration) CheckPath added in v0.14.40

func (f *FolderConfiguration) CheckPath() error

CheckPath returns nil if the folder root exists and contains the marker file

func (FolderConfiguration) Copy

func (*FolderConfiguration) CreateMarker

func (f *FolderConfiguration) CreateMarker() error

func (*FolderConfiguration) CreateRoot added in v0.14.28

func (f *FolderConfiguration) CreateRoot() (err error)

func (FolderConfiguration) Description added in v0.14.12

func (f FolderConfiguration) Description() string

func (*FolderConfiguration) Descriptor added in v1.10.0

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

func (*FolderConfiguration) DeviceIDs

func (f *FolderConfiguration) DeviceIDs() []protocol.DeviceID

func (FolderConfiguration) Filesystem added in v0.14.37

func (f FolderConfiguration) Filesystem() fs.Filesystem

func (*FolderConfiguration) Marshal added in v1.11.0

func (m *FolderConfiguration) Marshal() (dAtA []byte, err error)

func (*FolderConfiguration) MarshalTo added in v1.11.0

func (m *FolderConfiguration) MarshalTo(dAtA []byte) (int, error)

func (*FolderConfiguration) MarshalToSizedBuffer added in v1.11.0

func (m *FolderConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (FolderConfiguration) ModTimeWindow added in v1.2.2

func (f FolderConfiguration) ModTimeWindow() time.Duration

func (*FolderConfiguration) ProtoMessage added in v1.10.0

func (*FolderConfiguration) ProtoMessage()

func (*FolderConfiguration) ProtoSize added in v1.10.0

func (m *FolderConfiguration) ProtoSize() (n int)

func (FolderConfiguration) RequiresRestartOnly added in v0.14.42

func (f FolderConfiguration) RequiresRestartOnly() FolderConfiguration

RequiresRestartOnly returns a copy with only the attributes that require restart on change.

func (*FolderConfiguration) Reset added in v1.10.0

func (m *FolderConfiguration) Reset()

func (*FolderConfiguration) SharedWith added in v0.14.49

func (f *FolderConfiguration) SharedWith(device protocol.DeviceID) bool

func (*FolderConfiguration) String added in v1.10.0

func (m *FolderConfiguration) String() string

func (*FolderConfiguration) Unmarshal added in v1.11.0

func (m *FolderConfiguration) Unmarshal(dAtA []byte) error

func (*FolderConfiguration) XXX_DiscardUnknown added in v1.10.0

func (m *FolderConfiguration) XXX_DiscardUnknown()

func (*FolderConfiguration) XXX_Marshal added in v1.10.0

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

func (*FolderConfiguration) XXX_Merge added in v1.10.0

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

func (*FolderConfiguration) XXX_Size added in v1.10.0

func (m *FolderConfiguration) XXX_Size() int

func (*FolderConfiguration) XXX_Unmarshal added in v1.10.0

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

type FolderDeviceConfiguration

type FolderDeviceConfiguration struct {
	DeviceID     github_com_syncthing_syncthing_lib_protocol.DeviceID `` /* 152-byte string literal not displayed */
	IntroducedBy github_com_syncthing_syncthing_lib_protocol.DeviceID `` /* 174-byte string literal not displayed */
}

func (*FolderDeviceConfiguration) Descriptor added in v1.10.0

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

func (*FolderDeviceConfiguration) Marshal added in v1.11.0

func (m *FolderDeviceConfiguration) Marshal() (dAtA []byte, err error)

func (*FolderDeviceConfiguration) MarshalTo added in v1.11.0

func (m *FolderDeviceConfiguration) MarshalTo(dAtA []byte) (int, error)

func (*FolderDeviceConfiguration) MarshalToSizedBuffer added in v1.11.0

func (m *FolderDeviceConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*FolderDeviceConfiguration) ProtoMessage added in v1.10.0

func (*FolderDeviceConfiguration) ProtoMessage()

func (*FolderDeviceConfiguration) ProtoSize added in v1.10.0

func (m *FolderDeviceConfiguration) ProtoSize() (n int)

func (*FolderDeviceConfiguration) Reset added in v1.10.0

func (m *FolderDeviceConfiguration) Reset()

func (*FolderDeviceConfiguration) String added in v1.10.0

func (m *FolderDeviceConfiguration) String() string

func (*FolderDeviceConfiguration) Unmarshal added in v1.11.0

func (m *FolderDeviceConfiguration) Unmarshal(dAtA []byte) error

func (*FolderDeviceConfiguration) XXX_DiscardUnknown added in v1.10.0

func (m *FolderDeviceConfiguration) XXX_DiscardUnknown()

func (*FolderDeviceConfiguration) XXX_Marshal added in v1.10.0

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

func (*FolderDeviceConfiguration) XXX_Merge added in v1.10.0

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

func (*FolderDeviceConfiguration) XXX_Size added in v1.10.0

func (m *FolderDeviceConfiguration) XXX_Size() int

func (*FolderDeviceConfiguration) XXX_Unmarshal added in v1.10.0

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

type FolderType added in v0.13.0

type FolderType int32
const (
	FolderTypeSendReceive FolderType = 0
	FolderTypeSendOnly    FolderType = 1
	FolderTypeReceiveOnly FolderType = 2
)

func (FolderType) EnumDescriptor added in v1.10.0

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

func (FolderType) MarshalText added in v0.13.0

func (t FolderType) MarshalText() ([]byte, error)

func (FolderType) String added in v0.13.0

func (t FolderType) String() string

func (*FolderType) UnmarshalText added in v0.13.0

func (t *FolderType) UnmarshalText(bs []byte) error

type GUIConfiguration

type GUIConfiguration struct {
	Enabled                   bool     `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled" xml:"enabled,attr" default:"true"`
	RawAddress                string   `protobuf:"bytes,2,opt,name=address,proto3" json:"address" xml:"address" default:"127.0.0.1:8384"`
	RawUnixSocketPermissions  string   `` /* 152-byte string literal not displayed */
	User                      string   `protobuf:"bytes,4,opt,name=user,proto3" json:"user" xml:"user,omitempty"`
	Password                  string   `protobuf:"bytes,5,opt,name=password,proto3" json:"password" xml:"password,omitempty"`
	AuthMode                  AuthMode `protobuf:"varint,6,opt,name=auth_mode,json=authMode,proto3,enum=config.AuthMode" json:"authMode" xml:"authMode,omitempty"`
	RawUseTLS                 bool     `protobuf:"varint,7,opt,name=use_tls,json=useTls,proto3" json:"useTLS" xml:"tls,attr"`
	APIKey                    string   `protobuf:"bytes,8,opt,name=api_key,json=apiKey,proto3" json:"apiKey" xml:"apikey,omitempty"`
	InsecureAdminAccess       bool     `` /* 145-byte string literal not displayed */
	Theme                     string   `protobuf:"bytes,10,opt,name=theme,proto3" json:"theme" xml:"theme" default:"default"`
	Debugging                 bool     `protobuf:"varint,11,opt,name=debugging,proto3" json:"debugging" xml:"debugging,attr"`
	InsecureSkipHostCheck     bool     `` /* 155-byte string literal not displayed */
	InsecureAllowFrameLoading bool     `` /* 171-byte string literal not displayed */
}

func (GUIConfiguration) Address

func (c GUIConfiguration) Address() string

func (GUIConfiguration) Copy added in v0.14.50

func (*GUIConfiguration) Descriptor added in v1.10.0

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

func (GUIConfiguration) IsAuthEnabled added in v0.14.51

func (c GUIConfiguration) IsAuthEnabled() bool

func (GUIConfiguration) IsOverridden added in v0.14.52

func (c GUIConfiguration) IsOverridden() bool

func (GUIConfiguration) IsValidAPIKey added in v0.12.18

func (c GUIConfiguration) IsValidAPIKey(apiKey string) bool

IsValidAPIKey returns true when the given API key is valid, including both the value in config and any overrides

func (*GUIConfiguration) Marshal added in v1.11.0

func (m *GUIConfiguration) Marshal() (dAtA []byte, err error)

func (*GUIConfiguration) MarshalTo added in v1.11.0

func (m *GUIConfiguration) MarshalTo(dAtA []byte) (int, error)

func (*GUIConfiguration) MarshalToSizedBuffer added in v1.11.0

func (m *GUIConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (GUIConfiguration) Network added in v0.14.52

func (c GUIConfiguration) Network() string

func (*GUIConfiguration) ProtoMessage added in v1.10.0

func (*GUIConfiguration) ProtoMessage()

func (*GUIConfiguration) ProtoSize added in v1.10.0

func (m *GUIConfiguration) ProtoSize() (n int)

func (*GUIConfiguration) Reset added in v1.10.0

func (m *GUIConfiguration) Reset()

func (*GUIConfiguration) String added in v1.10.0

func (m *GUIConfiguration) String() string

func (GUIConfiguration) URL added in v0.12.0

func (c GUIConfiguration) URL() string

func (GUIConfiguration) UnixSocketPermissions added in v1.4.1

func (c GUIConfiguration) UnixSocketPermissions() os.FileMode

func (*GUIConfiguration) Unmarshal added in v1.11.0

func (m *GUIConfiguration) Unmarshal(dAtA []byte) error

func (GUIConfiguration) UseTLS

func (c GUIConfiguration) UseTLS() bool

func (*GUIConfiguration) XXX_DiscardUnknown added in v1.10.0

func (m *GUIConfiguration) XXX_DiscardUnknown()

func (*GUIConfiguration) XXX_Marshal added in v1.10.0

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

func (*GUIConfiguration) XXX_Merge added in v1.10.0

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

func (*GUIConfiguration) XXX_Size added in v1.10.0

func (m *GUIConfiguration) XXX_Size() int

func (*GUIConfiguration) XXX_Unmarshal added in v1.10.0

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

type LDAPConfiguration added in v0.14.51

type LDAPConfiguration struct {
	Address            string        `protobuf:"bytes,1,opt,name=address,proto3" json:"address" xml:"address,omitempty"`
	BindDN             string        `protobuf:"bytes,2,opt,name=bind_dn,json=bindDn,proto3" json:"bindDN" xml:"bindDN,omitempty"`
	Transport          LDAPTransport `protobuf:"varint,3,opt,name=transport,proto3,enum=config.LDAPTransport" json:"transport" xml:"transport,omitempty"`
	InsecureSkipVerify bool          `` /* 157-byte string literal not displayed */
	SearchBaseDN       string        `protobuf:"bytes,5,opt,name=search_base_dn,json=searchBaseDn,proto3" json:"searchBaseDN" xml:"searchBaseDN,omitempty"`
	SearchFilter       string        `protobuf:"bytes,6,opt,name=search_filter,json=searchFilter,proto3" json:"searchFilter" xml:"searchFilter,omitempty"`
}

func (LDAPConfiguration) Copy added in v0.14.51

func (*LDAPConfiguration) Descriptor added in v1.10.0

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

func (*LDAPConfiguration) Marshal added in v1.11.0

func (m *LDAPConfiguration) Marshal() (dAtA []byte, err error)

func (*LDAPConfiguration) MarshalTo added in v1.11.0

func (m *LDAPConfiguration) MarshalTo(dAtA []byte) (int, error)

func (*LDAPConfiguration) MarshalToSizedBuffer added in v1.11.0

func (m *LDAPConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LDAPConfiguration) ProtoMessage added in v1.10.0

func (*LDAPConfiguration) ProtoMessage()

func (*LDAPConfiguration) ProtoSize added in v1.10.0

func (m *LDAPConfiguration) ProtoSize() (n int)

func (*LDAPConfiguration) Reset added in v1.10.0

func (m *LDAPConfiguration) Reset()

func (*LDAPConfiguration) String added in v1.10.0

func (m *LDAPConfiguration) String() string

func (*LDAPConfiguration) Unmarshal added in v1.11.0

func (m *LDAPConfiguration) Unmarshal(dAtA []byte) error

func (*LDAPConfiguration) XXX_DiscardUnknown added in v1.10.0

func (m *LDAPConfiguration) XXX_DiscardUnknown()

func (*LDAPConfiguration) XXX_Marshal added in v1.10.0

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

func (*LDAPConfiguration) XXX_Merge added in v1.10.0

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

func (*LDAPConfiguration) XXX_Size added in v1.10.0

func (m *LDAPConfiguration) XXX_Size() int

func (*LDAPConfiguration) XXX_Unmarshal added in v1.10.0

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

type LDAPTransport added in v0.14.51

type LDAPTransport int32
const (
	LDAPTransportPlain    LDAPTransport = 0
	LDAPTransportTLS      LDAPTransport = 2
	LDAPTransportStartTLS LDAPTransport = 3
)

func (LDAPTransport) EnumDescriptor added in v1.10.0

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

func (LDAPTransport) MarshalText added in v0.14.51

func (t LDAPTransport) MarshalText() ([]byte, error)

func (LDAPTransport) String added in v0.14.51

func (t LDAPTransport) String() string

func (*LDAPTransport) UnmarshalText added in v0.14.51

func (t *LDAPTransport) UnmarshalText(bs []byte) error

type ObservedDevice added in v0.14.51

type ObservedDevice struct {
	Time    time.Time                                            `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time" xml:"time,attr"`
	ID      github_com_syncthing_syncthing_lib_protocol.DeviceID `` /* 131-byte string literal not displayed */
	Name    string                                               `protobuf:"bytes,3,opt,name=name,proto3" json:"name" xml:"name,attr"`
	Address string                                               `protobuf:"bytes,4,opt,name=address,proto3" json:"address" xml:"address,attr"`
}

func (*ObservedDevice) Descriptor added in v1.10.0

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

func (*ObservedDevice) Marshal added in v1.11.0

func (m *ObservedDevice) Marshal() (dAtA []byte, err error)

func (*ObservedDevice) MarshalTo added in v1.11.0

func (m *ObservedDevice) MarshalTo(dAtA []byte) (int, error)

func (*ObservedDevice) MarshalToSizedBuffer added in v1.11.0

func (m *ObservedDevice) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ObservedDevice) ProtoMessage added in v1.10.0

func (*ObservedDevice) ProtoMessage()

func (*ObservedDevice) ProtoSize added in v1.10.0

func (m *ObservedDevice) ProtoSize() (n int)

func (*ObservedDevice) Reset added in v1.10.0

func (m *ObservedDevice) Reset()

func (*ObservedDevice) String added in v1.10.0

func (m *ObservedDevice) String() string

func (*ObservedDevice) Unmarshal added in v1.11.0

func (m *ObservedDevice) Unmarshal(dAtA []byte) error

func (*ObservedDevice) XXX_DiscardUnknown added in v1.10.0

func (m *ObservedDevice) XXX_DiscardUnknown()

func (*ObservedDevice) XXX_Marshal added in v1.10.0

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

func (*ObservedDevice) XXX_Merge added in v1.10.0

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

func (*ObservedDevice) XXX_Size added in v1.10.0

func (m *ObservedDevice) XXX_Size() int

func (*ObservedDevice) XXX_Unmarshal added in v1.10.0

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

type ObservedFolder added in v0.14.51

type ObservedFolder struct {
	Time  time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time" xml:"time,attr"`
	ID    string    `protobuf:"bytes,2,opt,name=id,proto3" json:"id" xml:"id,attr"`
	Label string    `protobuf:"bytes,3,opt,name=label,proto3" json:"label" xml:"label,attr"`
}

func (*ObservedFolder) Descriptor added in v1.10.0

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

func (*ObservedFolder) Marshal added in v1.11.0

func (m *ObservedFolder) Marshal() (dAtA []byte, err error)

func (*ObservedFolder) MarshalTo added in v1.11.0

func (m *ObservedFolder) MarshalTo(dAtA []byte) (int, error)

func (*ObservedFolder) MarshalToSizedBuffer added in v1.11.0

func (m *ObservedFolder) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ObservedFolder) ProtoMessage added in v1.10.0

func (*ObservedFolder) ProtoMessage()

func (*ObservedFolder) ProtoSize added in v1.10.0

func (m *ObservedFolder) ProtoSize() (n int)

func (*ObservedFolder) Reset added in v1.10.0

func (m *ObservedFolder) Reset()

func (*ObservedFolder) String added in v1.10.0

func (m *ObservedFolder) String() string

func (*ObservedFolder) Unmarshal added in v1.11.0

func (m *ObservedFolder) Unmarshal(dAtA []byte) error

func (*ObservedFolder) XXX_DiscardUnknown added in v1.10.0

func (m *ObservedFolder) XXX_DiscardUnknown()

func (*ObservedFolder) XXX_Marshal added in v1.10.0

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

func (*ObservedFolder) XXX_Merge added in v1.10.0

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

func (*ObservedFolder) XXX_Size added in v1.10.0

func (m *ObservedFolder) XXX_Size() int

func (*ObservedFolder) XXX_Unmarshal added in v1.10.0

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

type OptionsConfiguration

type OptionsConfiguration struct {
	RawListenAddresses      []string `` /* 133-byte string literal not displayed */
	RawGlobalAnnServers     []string `` /* 161-byte string literal not displayed */
	GlobalAnnEnabled        bool     `` /* 160-byte string literal not displayed */
	LocalAnnEnabled         bool     `` /* 156-byte string literal not displayed */
	LocalAnnPort            int      `` /* 156-byte string literal not displayed */
	LocalAnnMCAddr          string   `` /* 184-byte string literal not displayed */
	MaxSendKbps             int      `protobuf:"varint,7,opt,name=max_send_kbps,json=maxSendKbps,proto3,casttype=int" json:"maxSendKbps" xml:"maxSendKbps"`
	MaxRecvKbps             int      `protobuf:"varint,8,opt,name=max_recv_kbps,json=maxRecvKbps,proto3,casttype=int" json:"maxRecvKbps" xml:"maxRecvKbps"`
	ReconnectIntervalS      int      `` /* 169-byte string literal not displayed */
	RelaysEnabled           bool     `` /* 126-byte string literal not displayed */
	RelayReconnectIntervalM int      `` /* 181-byte string literal not displayed */
	StartBrowser            bool     `protobuf:"varint,12,opt,name=start_browser,json=startBrowser,proto3" json:"startBrowser" xml:"startBrowser" default:"true"`
	NATEnabled              bool     `` /* 133-byte string literal not displayed */
	NATLeaseM               int      `` /* 153-byte string literal not displayed */
	NATRenewalM             int      `` /* 161-byte string literal not displayed */
	NATTimeoutS             int      `` /* 161-byte string literal not displayed */
	URAccepted              int      `` /* 137-byte string literal not displayed */
	URSeen                  int      `protobuf:"varint,19,opt,name=usage_reporting_seen,json=usageReportingSeen,proto3,casttype=int" json:"urSeen" xml:"urSeen"`
	URUniqueID              string   `protobuf:"bytes,20,opt,name=usage_reporting_unique_id,json=usageReportingUniqueId,proto3" json:"urUniqueId" xml:"urUniqueID"`
	URURL                   string   `` /* 148-byte string literal not displayed */
	URPostInsecurely        bool     `` /* 165-byte string literal not displayed */
	URInitialDelayS         int      `` /* 174-byte string literal not displayed */
	RestartOnWakeup         bool     `` /* 135-byte string literal not displayed */
	AutoUpgradeIntervalH    int      `` /* 167-byte string literal not displayed */
	UpgradeToPreReleases    bool     `` /* 141-byte string literal not displayed */
	KeepTemporariesH        int      `` /* 150-byte string literal not displayed */
	CacheIgnoredFiles       bool     `` /* 144-byte string literal not displayed */
	ProgressUpdateIntervalS int      `` /* 178-byte string literal not displayed */
	LimitBandwidthInLan     bool     `` /* 153-byte string literal not displayed */
	MinHomeDiskFree         Size     `` /* 134-byte string literal not displayed */
	ReleasesURL             string   `` /* 153-byte string literal not displayed */
	AlwaysLocalNets         []string `protobuf:"bytes,33,rep,name=always_local_nets,json=alwaysLocalNets,proto3" json:"alwaysLocalNets" xml:"alwaysLocalNet"`
	OverwriteRemoteDevNames bool     `` /* 219-byte string literal not displayed */
	TempIndexMinBlocks      int      `` /* 159-byte string literal not displayed */
	UnackedNotificationIDs  []string `` /* 146-byte string literal not displayed */
	TrafficClass            int      `protobuf:"varint,37,opt,name=traffic_class,json=trafficClass,proto3,casttype=int" json:"trafficClass" xml:"trafficClass"`
	DefaultFolderPath       string   `` /* 139-byte string literal not displayed */
	SetLowPriority          bool     `` /* 131-byte string literal not displayed */
	RawMaxFolderConcurrency int      `` /* 153-byte string literal not displayed */
	CRURL                   string   `` /* 162-byte string literal not displayed */
	CREnabled               bool     `` /* 159-byte string literal not displayed */
	StunKeepaliveStartS     int      `` /* 164-byte string literal not displayed */
	StunKeepaliveMinS       int      `` /* 155-byte string literal not displayed */
	RawStunServers          []string `protobuf:"bytes,45,rep,name=stun_servers,json=stunServers,proto3" json:"stunServers" xml:"stunServer" default:"default"`
	DatabaseTuning          Tuning   `` /* 149-byte string literal not displayed */
	RawMaxCIRequestKiB      int      `` /* 199-byte string literal not displayed */
	AnnounceLANAddresses    bool     `` /* 155-byte string literal not displayed */
	SendFullIndexOnUpgrade  bool     `` /* 150-byte string literal not displayed */
	// Legacy deprecated
	DeprecatedUPnPEnabled  bool `protobuf:"varint,9000,opt,name=upnp_enabled,json=upnpEnabled,proto3" json:"-" xml:"upnpEnabled,omitempty"`                  // Deprecated: Do not use.
	DeprecatedUPnPLeaseM   int  `protobuf:"varint,9001,opt,name=upnp_lease_m,json=upnpLeaseM,proto3,casttype=int" json:"-" xml:"upnpLeaseMinutes,omitempty"` // Deprecated: Do not use.
	DeprecatedUPnPRenewalM int  ``                                                                                                                           // Deprecated: Do not use.
	/* 128-byte string literal not displayed */
	DeprecatedUPnPTimeoutS int `` // Deprecated: Do not use.
	/* 128-byte string literal not displayed */
	DeprecatedRelayServers       []string `protobuf:"bytes,9004,rep,name=relay_servers,json=relayServers,proto3" json:"-" xml:"relayServer,omitempty"` // Deprecated: Do not use.
	DeprecatedMinHomeDiskFreePct float64  ``                                                                                                           // Deprecated: Do not use.
	/* 130-byte string literal not displayed */
	DeprecatedMaxConcurrentScans int `` // Deprecated: Do not use.
	/* 140-byte string literal not displayed */
}

func (OptionsConfiguration) AutoUpgradeEnabled added in v1.9.0

func (opts OptionsConfiguration) AutoUpgradeEnabled() bool

func (OptionsConfiguration) Copy

func (*OptionsConfiguration) Descriptor added in v1.10.0

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

func (OptionsConfiguration) GlobalDiscoveryServers added in v1.3.3

func (opts OptionsConfiguration) GlobalDiscoveryServers() []string

func (OptionsConfiguration) IsStunDisabled added in v1.2.0

func (opts OptionsConfiguration) IsStunDisabled() bool

func (OptionsConfiguration) ListenAddresses added in v0.13.0

func (opts OptionsConfiguration) ListenAddresses() []string

func (*OptionsConfiguration) Marshal added in v1.11.0

func (m *OptionsConfiguration) Marshal() (dAtA []byte, err error)

func (*OptionsConfiguration) MarshalTo added in v1.11.0

func (m *OptionsConfiguration) MarshalTo(dAtA []byte) (int, error)

func (*OptionsConfiguration) MarshalToSizedBuffer added in v1.11.0

func (m *OptionsConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (OptionsConfiguration) MaxConcurrentIncomingRequestKiB added in v1.4.0

func (opts OptionsConfiguration) MaxConcurrentIncomingRequestKiB() int

func (OptionsConfiguration) MaxFolderConcurrency added in v1.4.0

func (opts OptionsConfiguration) MaxFolderConcurrency() int

func (*OptionsConfiguration) ProtoMessage added in v1.10.0

func (*OptionsConfiguration) ProtoMessage()

func (*OptionsConfiguration) ProtoSize added in v1.10.0

func (m *OptionsConfiguration) ProtoSize() (n int)

func (OptionsConfiguration) RequiresRestartOnly added in v0.14.42

func (opts OptionsConfiguration) RequiresRestartOnly() OptionsConfiguration

RequiresRestartOnly returns a copy with only the attributes that require restart on change.

func (*OptionsConfiguration) Reset added in v1.10.0

func (m *OptionsConfiguration) Reset()

func (*OptionsConfiguration) String added in v1.10.0

func (m *OptionsConfiguration) String() string

func (OptionsConfiguration) StunServers added in v0.14.25

func (opts OptionsConfiguration) StunServers() []string

func (*OptionsConfiguration) Unmarshal added in v1.11.0

func (m *OptionsConfiguration) Unmarshal(dAtA []byte) error

func (*OptionsConfiguration) XXX_DiscardUnknown added in v1.10.0

func (m *OptionsConfiguration) XXX_DiscardUnknown()

func (*OptionsConfiguration) XXX_Marshal added in v1.10.0

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

func (*OptionsConfiguration) XXX_Merge added in v1.10.0

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

func (*OptionsConfiguration) XXX_Size added in v1.10.0

func (m *OptionsConfiguration) XXX_Size() int

func (*OptionsConfiguration) XXX_Unmarshal added in v1.10.0

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

type PullOrder

type PullOrder int32
const (
	PullOrderRandom        PullOrder = 0
	PullOrderAlphabetic    PullOrder = 1
	PullOrderSmallestFirst PullOrder = 2
	PullOrderLargestFirst  PullOrder = 3
	PullOrderOldestFirst   PullOrder = 4
	PullOrderNewestFirst   PullOrder = 5
)

func (PullOrder) EnumDescriptor added in v1.10.0

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

func (PullOrder) MarshalText

func (o PullOrder) MarshalText() ([]byte, error)

func (PullOrder) String

func (o PullOrder) String() string

func (*PullOrder) UnmarshalText

func (o *PullOrder) UnmarshalText(bs []byte) error

type Size added in v0.14.28

type Size struct {
	Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value" xml:",chardata"`
	Unit  string  `protobuf:"bytes,2,opt,name=unit,proto3" json:"unit" xml:"unit,attr"`
}

func ParseSize added in v0.14.28

func ParseSize(s string) (Size, error)

func (Size) BaseValue added in v0.14.28

func (s Size) BaseValue() float64

func (*Size) Descriptor added in v1.10.0

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

func (*Size) Marshal added in v1.11.0

func (m *Size) Marshal() (dAtA []byte, err error)

func (*Size) MarshalTo added in v1.11.0

func (m *Size) MarshalTo(dAtA []byte) (int, error)

func (*Size) MarshalToSizedBuffer added in v1.11.0

func (m *Size) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Size) ParseDefault added in v0.14.28

func (s *Size) ParseDefault(str string) error

func (Size) Percentage added in v0.14.28

func (s Size) Percentage() bool

func (*Size) ProtoMessage added in v1.10.0

func (*Size) ProtoMessage()

func (*Size) ProtoSize added in v1.10.0

func (m *Size) ProtoSize() (n int)

func (*Size) Reset added in v1.10.0

func (m *Size) Reset()

func (Size) String added in v0.14.28

func (s Size) String() string

func (*Size) Unmarshal added in v1.11.0

func (m *Size) Unmarshal(dAtA []byte) error

func (*Size) XXX_DiscardUnknown added in v1.10.0

func (m *Size) XXX_DiscardUnknown()

func (*Size) XXX_Marshal added in v1.10.0

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

func (*Size) XXX_Merge added in v1.10.0

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

func (*Size) XXX_Size added in v1.10.0

func (m *Size) XXX_Size() int

func (*Size) XXX_Unmarshal added in v1.10.0

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

type Tuning added in v1.3.0

type Tuning int32
const (
	TuningAuto  Tuning = 0
	TuningSmall Tuning = 1
	TuningLarge Tuning = 2
)

func (Tuning) EnumDescriptor added in v1.10.0

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

func (Tuning) MarshalText added in v1.3.0

func (t Tuning) MarshalText() ([]byte, error)

func (Tuning) String added in v1.3.0

func (t Tuning) String() string

func (*Tuning) UnmarshalText added in v1.3.0

func (t *Tuning) UnmarshalText(bs []byte) error

type VersioningConfiguration

type VersioningConfiguration struct {
	Type             string            `protobuf:"bytes,1,opt,name=type,proto3" json:"type" `
	Params           map[string]string `` /* 148-byte string literal not displayed */
	CleanupIntervalS int               `` /* 128-byte string literal not displayed */
}

VersioningConfiguration is used in the code and for JSON serialization

func (VersioningConfiguration) Copy added in v0.12.0

func (*VersioningConfiguration) Descriptor added in v1.10.0

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

func (*VersioningConfiguration) Marshal added in v1.11.0

func (m *VersioningConfiguration) Marshal() (dAtA []byte, err error)

func (*VersioningConfiguration) MarshalTo added in v1.11.0

func (m *VersioningConfiguration) MarshalTo(dAtA []byte) (int, error)

func (*VersioningConfiguration) MarshalToSizedBuffer added in v1.11.0

func (m *VersioningConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*VersioningConfiguration) MarshalXML

func (c *VersioningConfiguration) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*VersioningConfiguration) ProtoMessage added in v1.10.0

func (*VersioningConfiguration) ProtoMessage()

func (*VersioningConfiguration) ProtoSize added in v1.10.0

func (m *VersioningConfiguration) ProtoSize() (n int)

func (*VersioningConfiguration) Reset added in v1.10.0

func (m *VersioningConfiguration) Reset()

func (*VersioningConfiguration) String added in v1.10.0

func (m *VersioningConfiguration) String() string

func (*VersioningConfiguration) Unmarshal added in v1.11.0

func (m *VersioningConfiguration) Unmarshal(dAtA []byte) error

func (*VersioningConfiguration) UnmarshalJSON added in v1.8.0

func (c *VersioningConfiguration) UnmarshalJSON(data []byte) error

func (*VersioningConfiguration) UnmarshalXML

func (c *VersioningConfiguration) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*VersioningConfiguration) XXX_DiscardUnknown added in v1.10.0

func (m *VersioningConfiguration) XXX_DiscardUnknown()

func (*VersioningConfiguration) XXX_Marshal added in v1.10.0

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

func (*VersioningConfiguration) XXX_Merge added in v1.10.0

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

func (*VersioningConfiguration) XXX_Size added in v1.10.0

func (m *VersioningConfiguration) XXX_Size() int

func (*VersioningConfiguration) XXX_Unmarshal added in v1.10.0

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

type Waiter added in v0.14.42

type Waiter interface {
	Wait()
}

Waiter allows to wait for the given config operation to complete.

type Wrapper

type Wrapper interface {
	ConfigPath() string

	RawCopy() Configuration
	Replace(cfg Configuration) (Waiter, error)
	RequiresRestart() bool
	Save() error

	GUI() GUIConfiguration
	SetGUI(gui GUIConfiguration) (Waiter, error)
	LDAP() LDAPConfiguration

	Options() OptionsConfiguration
	SetOptions(opts OptionsConfiguration) (Waiter, error)

	Folder(id string) (FolderConfiguration, bool)
	Folders() map[string]FolderConfiguration
	FolderList() []FolderConfiguration
	SetFolder(fld FolderConfiguration) (Waiter, error)
	SetFolders(folders []FolderConfiguration) (Waiter, error)

	Device(id protocol.DeviceID) (DeviceConfiguration, bool)
	Devices() map[protocol.DeviceID]DeviceConfiguration
	RemoveDevice(id protocol.DeviceID) (Waiter, error)
	SetDevice(DeviceConfiguration) (Waiter, error)
	SetDevices([]DeviceConfiguration) (Waiter, error)

	AddOrUpdatePendingDevice(device protocol.DeviceID, name, address string)
	AddOrUpdatePendingFolder(id, label string, device protocol.DeviceID)
	IgnoredDevice(id protocol.DeviceID) bool
	IgnoredFolder(device protocol.DeviceID, folder string) bool

	Subscribe(c Committer)
	Unsubscribe(c Committer)
}

A Wrapper around a Configuration that manages loads, saves and published notifications of changes to registered Handlers

func Load

func Load(path string, myID protocol.DeviceID, evLogger events.Logger) (Wrapper, int, error)

Load loads an existing file on disk and returns a new configuration wrapper.

func Wrap

func Wrap(path string, cfg Configuration, evLogger events.Logger) Wrapper

Wrap wraps an existing Configuration structure and ties it to a file on disk.

Jump to

Keyboard shortcuts

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