config

package
v0.0.0-...-129a086 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 41 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	OldestHandledVersion = 10
	CurrentVersion       = 36
	MaxRescanIntervalS   = 365 * 24 * 60 * 60
)
View Source
const (
	DefaultMarkerName   = ".stfolder"
	EncryptionTokenName = "syncthing-encryption_password_token"
)

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",
	3: "FOLDER_TYPE_RECEIVE_ENCRYPTED",
}
View Source
var FolderType_value = map[string]int32{
	"FOLDER_TYPE_SEND_RECEIVE":      0,
	"FOLDER_TYPE_SEND_ONLY":         1,
	"FOLDER_TYPE_RECEIVE_ONLY":      2,
	"FOLDER_TYPE_RECEIVE_ENCRYPTED": 3,
}
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

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

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

func (AuthMode) EnumDescriptor

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

func (AuthMode) MarshalText

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

func (AuthMode) String

func (t AuthMode) String() string

func (*AuthMode) UnmarshalText

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

type BlockPullOrder

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

func (BlockPullOrder) EnumDescriptor

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

func (BlockPullOrder) MarshalText

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

func (BlockPullOrder) String

func (o BlockPullOrder) String() string

func (*BlockPullOrder) UnmarshalText

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

type Committer

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

The Committer and Verifier interfaces are 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 that implements it, with copies of 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.

A Committer must take care not to hold any locks while changing the configuration (e.g. calling Wrapper.SetFolder), that are also acquired in any methods of the Committer interface.

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"`
	DeprecatedPendingDevices []ObservedDevice      `protobuf:"bytes,8,rep,name=pending_devices,json=pendingDevices,proto3" json:"-" xml:"pendingDevice,omitempty"` // Deprecated: Do not use.
	Defaults                 Defaults              `protobuf:"bytes,9,opt,name=defaults,proto3" json:"defaults" xml:"defaults"`
}

func New

func ReadJSON

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

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

func (*Configuration) Device

func (*Configuration) DeviceMap

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

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

func (*Configuration) Folder

func (cfg *Configuration) Folder(id string) (FolderConfiguration, int, bool)

func (*Configuration) FolderMap

func (cfg *Configuration) FolderMap() map[string]FolderConfiguration

FolderMap returns a map of folder ID to folder configuration for the given configuration.

func (Configuration) FolderPasswords

func (cfg Configuration) FolderPasswords(device protocol.DeviceID) map[string]string

FolderPasswords returns the folder passwords set for this device, for folders that have an encryption password set.

func (*Configuration) Marshal

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

func (*Configuration) MarshalTo

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

func (*Configuration) MarshalToSizedBuffer

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

func (*Configuration) ProbeFreePorts

func (cfg *Configuration) ProbeFreePorts() error

func (*Configuration) ProtoMessage

func (*Configuration) ProtoMessage()

func (*Configuration) ProtoSize

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

func (*Configuration) Reset

func (m *Configuration) Reset()

func (*Configuration) SetDevice

func (cfg *Configuration) SetDevice(device DeviceConfiguration)

func (*Configuration) SetDevices

func (cfg *Configuration) SetDevices(devices []DeviceConfiguration)

func (*Configuration) SetFolder

func (cfg *Configuration) SetFolder(folder FolderConfiguration)

func (*Configuration) SetFolders

func (cfg *Configuration) SetFolders(folders []FolderConfiguration)

func (*Configuration) String

func (m *Configuration) String() string

func (*Configuration) Unmarshal

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

func (*Configuration) WriteXML

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

func (*Configuration) XXX_DiscardUnknown

func (m *Configuration) XXX_DiscardUnknown()

func (*Configuration) XXX_Marshal

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

func (*Configuration) XXX_Merge

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

func (*Configuration) XXX_Size

func (m *Configuration) XXX_Size() int

func (*Configuration) XXX_Unmarshal

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

type Defaults

type Defaults struct {
	Folder  FolderConfiguration `protobuf:"bytes,1,opt,name=folder,proto3" json:"folder" xml:"folder"`
	Device  DeviceConfiguration `protobuf:"bytes,2,opt,name=device,proto3" json:"device" xml:"device"`
	Ignores Ignores             `protobuf:"bytes,3,opt,name=ignores,proto3" json:"ignores" xml:"ignores"`
}

func (*Defaults) Descriptor

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

func (*Defaults) Marshal

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

func (*Defaults) MarshalTo

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

func (*Defaults) MarshalToSizedBuffer

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

func (*Defaults) ProtoMessage

func (*Defaults) ProtoMessage()

func (*Defaults) ProtoSize

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

func (*Defaults) Reset

func (m *Defaults) Reset()

func (*Defaults) String

func (m *Defaults) String() string

func (*Defaults) Unmarshal

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

func (*Defaults) XXX_DiscardUnknown

func (m *Defaults) XXX_DiscardUnknown()

func (*Defaults) XXX_Marshal

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

func (*Defaults) XXX_Merge

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

func (*Defaults) XXX_Size

func (m *Defaults) XXX_Size() int

func (*Defaults) XXX_Unmarshal

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

type DeviceConfiguration

type DeviceConfiguration struct {
	DeviceID                 github_com_zebfross_syncthing_mobile_lib_protocol.DeviceID `` /* 175-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_zebfross_syncthing_mobile_lib_protocol.DeviceID `` /* 197-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"`
	DeprecatedPendingFolders []ObservedFolder                                           `protobuf:"bytes,15,rep,name=pending_folders,json=pendingFolders,proto3" json:"-" xml:"pendingFolder,omitempty"` // Deprecated: Do not use.
	MaxRequestKiB            int                                                        `protobuf:"varint,16,opt,name=max_request_kib,json=maxRequestKib,proto3,casttype=int" json:"maxRequestKiB" xml:"maxRequestKiB"`
	Untrusted                bool                                                       `protobuf:"varint,17,opt,name=untrusted,proto3" json:"untrusted" xml:"untrusted"`
	RemoteGUIPort            int                                                        `protobuf:"varint,18,opt,name=remote_gui_port,json=remoteGuiPort,proto3,casttype=int" json:"remoteGUIPort" xml:"remoteGUIPort"`
}

func (DeviceConfiguration) Copy

func (*DeviceConfiguration) Description

func (cfg *DeviceConfiguration) Description() string

func (*DeviceConfiguration) Descriptor

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

func (*DeviceConfiguration) IgnoredFolder

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

func (*DeviceConfiguration) Marshal

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

func (*DeviceConfiguration) MarshalTo

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

func (*DeviceConfiguration) MarshalToSizedBuffer

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

func (*DeviceConfiguration) ProtoMessage

func (*DeviceConfiguration) ProtoMessage()

func (*DeviceConfiguration) ProtoSize

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

func (*DeviceConfiguration) Reset

func (m *DeviceConfiguration) Reset()

func (*DeviceConfiguration) String

func (m *DeviceConfiguration) String() string

func (*DeviceConfiguration) Unmarshal

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

func (*DeviceConfiguration) XXX_DiscardUnknown

func (m *DeviceConfiguration) XXX_DiscardUnknown()

func (*DeviceConfiguration) XXX_Marshal

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

func (*DeviceConfiguration) XXX_Merge

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

func (*DeviceConfiguration) XXX_Size

func (m *DeviceConfiguration) XXX_Size() int

func (*DeviceConfiguration) XXX_Unmarshal

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" nodefault:"true"`
	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" default:"~"`
	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" default:"1 %"`
	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"`
	SyncOwnership           bool                        `protobuf:"varint,35,opt,name=sync_ownership,json=syncOwnership,proto3" json:"syncOwnership" xml:"syncOwnership"`
	// 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 (*FolderConfiguration) CheckAvailableSpace

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

func (*FolderConfiguration) CheckPath

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

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

func (FolderConfiguration) Description

func (f FolderConfiguration) Description() string

func (*FolderConfiguration) Descriptor

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

func (*FolderConfiguration) Device

func (*FolderConfiguration) DeviceIDs

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

func (FolderConfiguration) Filesystem

func (f FolderConfiguration) Filesystem(fset *db.FileSet) fs.Filesystem

Filesystem creates a filesystem for the path and options of this folder. The fset parameter may be nil, in which case no mtime handling on top of the fileystem is provided.

func (*FolderConfiguration) Marshal

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

func (*FolderConfiguration) MarshalTo

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

func (*FolderConfiguration) MarshalToSizedBuffer

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

func (FolderConfiguration) ModTimeWindow

func (f FolderConfiguration) ModTimeWindow() time.Duration

func (*FolderConfiguration) ProtoMessage

func (*FolderConfiguration) ProtoMessage()

func (*FolderConfiguration) ProtoSize

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

func (FolderConfiguration) RequiresRestartOnly

func (f FolderConfiguration) RequiresRestartOnly() FolderConfiguration

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

func (*FolderConfiguration) Reset

func (m *FolderConfiguration) Reset()

func (*FolderConfiguration) SharedWith

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

func (*FolderConfiguration) String

func (m *FolderConfiguration) String() string

func (*FolderConfiguration) Unmarshal

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

func (*FolderConfiguration) XXX_DiscardUnknown

func (m *FolderConfiguration) XXX_DiscardUnknown()

func (*FolderConfiguration) XXX_Marshal

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

func (*FolderConfiguration) XXX_Merge

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

func (*FolderConfiguration) XXX_Size

func (m *FolderConfiguration) XXX_Size() int

func (*FolderConfiguration) XXX_Unmarshal

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

type FolderDeviceConfiguration

type FolderDeviceConfiguration struct {
	DeviceID           github_com_zebfross_syncthing_mobile_lib_protocol.DeviceID `` /* 158-byte string literal not displayed */
	IntroducedBy       github_com_zebfross_syncthing_mobile_lib_protocol.DeviceID `` /* 180-byte string literal not displayed */
	EncryptionPassword string                                                     `` /* 129-byte string literal not displayed */
}

func (*FolderDeviceConfiguration) Descriptor

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

func (*FolderDeviceConfiguration) Marshal

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

func (*FolderDeviceConfiguration) MarshalTo

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

func (*FolderDeviceConfiguration) MarshalToSizedBuffer

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

func (*FolderDeviceConfiguration) ProtoMessage

func (*FolderDeviceConfiguration) ProtoMessage()

func (*FolderDeviceConfiguration) ProtoSize

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

func (*FolderDeviceConfiguration) Reset

func (m *FolderDeviceConfiguration) Reset()

func (*FolderDeviceConfiguration) String

func (m *FolderDeviceConfiguration) String() string

func (*FolderDeviceConfiguration) Unmarshal

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

func (*FolderDeviceConfiguration) XXX_DiscardUnknown

func (m *FolderDeviceConfiguration) XXX_DiscardUnknown()

func (*FolderDeviceConfiguration) XXX_Marshal

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

func (*FolderDeviceConfiguration) XXX_Merge

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

func (*FolderDeviceConfiguration) XXX_Size

func (m *FolderDeviceConfiguration) XXX_Size() int

func (*FolderDeviceConfiguration) XXX_Unmarshal

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

type FolderType

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

func (FolderType) EnumDescriptor

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

func (FolderType) MarshalText

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

func (FolderType) String

func (t FolderType) String() string

func (*FolderType) UnmarshalText

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

func (c GUIConfiguration) CompareHashedPassword(password string) error

CompareHashedPassword returns nil when the given plaintext password matches the stored hash.

func (GUIConfiguration) Copy

func (*GUIConfiguration) Descriptor

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

func (*GUIConfiguration) HashAndSetPassword

func (c *GUIConfiguration) HashAndSetPassword(password string) error

SetHashedPassword hashes the given plaintext password and stores the new hash.

func (GUIConfiguration) IsAuthEnabled

func (c GUIConfiguration) IsAuthEnabled() bool

func (GUIConfiguration) IsOverridden

func (GUIConfiguration) IsOverridden() bool

func (GUIConfiguration) IsValidAPIKey

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

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

func (*GUIConfiguration) MarshalTo

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

func (*GUIConfiguration) MarshalToSizedBuffer

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

func (GUIConfiguration) Network

func (c GUIConfiguration) Network() string

func (*GUIConfiguration) ProtoMessage

func (*GUIConfiguration) ProtoMessage()

func (*GUIConfiguration) ProtoSize

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

func (*GUIConfiguration) Reset

func (m *GUIConfiguration) Reset()

func (*GUIConfiguration) String

func (m *GUIConfiguration) String() string

func (GUIConfiguration) URL

func (c GUIConfiguration) URL() string

func (GUIConfiguration) UnixSocketPermissions

func (c GUIConfiguration) UnixSocketPermissions() os.FileMode

func (*GUIConfiguration) Unmarshal

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

func (GUIConfiguration) UseTLS

func (c GUIConfiguration) UseTLS() bool

func (*GUIConfiguration) XXX_DiscardUnknown

func (m *GUIConfiguration) XXX_DiscardUnknown()

func (*GUIConfiguration) XXX_Marshal

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

func (*GUIConfiguration) XXX_Merge

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

func (*GUIConfiguration) XXX_Size

func (m *GUIConfiguration) XXX_Size() int

func (*GUIConfiguration) XXX_Unmarshal

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

type Ignores

type Ignores struct {
	Lines []string `protobuf:"bytes,1,rep,name=lines,proto3" json:"lines" xml:"line"`
}

func (Ignores) Copy

func (i Ignores) Copy() Ignores

func (*Ignores) Descriptor

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

func (*Ignores) Marshal

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

func (*Ignores) MarshalTo

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

func (*Ignores) MarshalToSizedBuffer

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

func (*Ignores) ProtoMessage

func (*Ignores) ProtoMessage()

func (*Ignores) ProtoSize

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

func (*Ignores) Reset

func (m *Ignores) Reset()

func (*Ignores) String

func (m *Ignores) String() string

func (*Ignores) Unmarshal

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

func (*Ignores) XXX_DiscardUnknown

func (m *Ignores) XXX_DiscardUnknown()

func (*Ignores) XXX_Marshal

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

func (*Ignores) XXX_Merge

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

func (*Ignores) XXX_Size

func (m *Ignores) XXX_Size() int

func (*Ignores) XXX_Unmarshal

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

type LDAPConfiguration

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

func (*LDAPConfiguration) Descriptor

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

func (*LDAPConfiguration) Marshal

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

func (*LDAPConfiguration) MarshalTo

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

func (*LDAPConfiguration) MarshalToSizedBuffer

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

func (*LDAPConfiguration) ProtoMessage

func (*LDAPConfiguration) ProtoMessage()

func (*LDAPConfiguration) ProtoSize

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

func (*LDAPConfiguration) Reset

func (m *LDAPConfiguration) Reset()

func (*LDAPConfiguration) String

func (m *LDAPConfiguration) String() string

func (*LDAPConfiguration) Unmarshal

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

func (*LDAPConfiguration) XXX_DiscardUnknown

func (m *LDAPConfiguration) XXX_DiscardUnknown()

func (*LDAPConfiguration) XXX_Marshal

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

func (*LDAPConfiguration) XXX_Merge

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

func (*LDAPConfiguration) XXX_Size

func (m *LDAPConfiguration) XXX_Size() int

func (*LDAPConfiguration) XXX_Unmarshal

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

type LDAPTransport

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

func (LDAPTransport) EnumDescriptor

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

func (LDAPTransport) MarshalText

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

func (LDAPTransport) String

func (t LDAPTransport) String() string

func (*LDAPTransport) UnmarshalText

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

type ModifyFunction

type ModifyFunction func(*Configuration)

ModifyFunction gets a pointer to a copy of the currently active configuration for modification.

type ObservedDevice

type ObservedDevice struct {
	Time    time.Time                                                  `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time" xml:"time,attr"`
	ID      github_com_zebfross_syncthing_mobile_lib_protocol.DeviceID `` /* 137-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

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

func (*ObservedDevice) Marshal

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

func (*ObservedDevice) MarshalTo

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

func (*ObservedDevice) MarshalToSizedBuffer

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

func (*ObservedDevice) ProtoMessage

func (*ObservedDevice) ProtoMessage()

func (*ObservedDevice) ProtoSize

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

func (*ObservedDevice) Reset

func (m *ObservedDevice) Reset()

func (*ObservedDevice) String

func (m *ObservedDevice) String() string

func (*ObservedDevice) Unmarshal

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

func (*ObservedDevice) XXX_DiscardUnknown

func (m *ObservedDevice) XXX_DiscardUnknown()

func (*ObservedDevice) XXX_Marshal

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

func (*ObservedDevice) XXX_Merge

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

func (*ObservedDevice) XXX_Size

func (m *ObservedDevice) XXX_Size() int

func (*ObservedDevice) XXX_Unmarshal

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

type ObservedFolder

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

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

func (*ObservedFolder) Marshal

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

func (*ObservedFolder) MarshalTo

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

func (*ObservedFolder) MarshalToSizedBuffer

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

func (*ObservedFolder) ProtoMessage

func (*ObservedFolder) ProtoMessage()

func (*ObservedFolder) ProtoSize

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

func (*ObservedFolder) Reset

func (m *ObservedFolder) Reset()

func (*ObservedFolder) String

func (m *ObservedFolder) String() string

func (*ObservedFolder) Unmarshal

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

func (*ObservedFolder) XXX_DiscardUnknown

func (m *ObservedFolder) XXX_DiscardUnknown()

func (*ObservedFolder) XXX_Marshal

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

func (*ObservedFolder) XXX_Merge

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

func (*ObservedFolder) XXX_Size

func (m *ObservedFolder) XXX_Size() int

func (*ObservedFolder) XXX_Unmarshal

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 */
	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"`
	DeprecatedDefaultFolderPath string   `protobuf:"bytes,38,opt,name=default_folder_path,json=defaultFolderPath,proto3" json:"-" xml:"defaultFolderPath,omitempty"` // Deprecated: Do not use.
	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 */
	FeatureFlags                []string `protobuf:"bytes,50,rep,name=feature_flags,json=featureFlags,proto3" json:"featureFlags" xml:"featureFlag"`
	// The number of connections at which we stop trying to connect to more
	// devices, zero meaning no limit. Does not affect incoming connections.
	ConnectionLimitEnough int `` /* 157-byte string literal not displayed */
	// The maximum number of connections which we will allow in total, zero
	// meaning no limit. Affects incoming connections and prevents
	// attempting outgoing connections.
	ConnectionLimitMax int `` /* 145-byte string literal not displayed */
	// When set, this allows TLS 1.2 on sync connections, where we otherwise
	// default to TLS 1.3+ only.
	InsecureAllowOldTLSVersions bool `` /* 170-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

func (opts OptionsConfiguration) AutoUpgradeEnabled() bool

func (OptionsConfiguration) Copy

func (*OptionsConfiguration) Descriptor

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

func (OptionsConfiguration) FeatureFlag

func (opts OptionsConfiguration) FeatureFlag(name string) bool

func (OptionsConfiguration) GlobalDiscoveryServers

func (opts OptionsConfiguration) GlobalDiscoveryServers() []string

func (OptionsConfiguration) IsStunDisabled

func (opts OptionsConfiguration) IsStunDisabled() bool

func (OptionsConfiguration) ListenAddresses

func (opts OptionsConfiguration) ListenAddresses() []string

func (OptionsConfiguration) LowestConnectionLimit

func (opts OptionsConfiguration) LowestConnectionLimit() int

LowestConnectionLimit is the lower of ConnectionLimitEnough or ConnectionLimitMax, or whichever of them is actually set if only one of them is set. It's the point where we should stop dialling.

func (*OptionsConfiguration) Marshal

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

func (*OptionsConfiguration) MarshalTo

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

func (*OptionsConfiguration) MarshalToSizedBuffer

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

func (OptionsConfiguration) MaxConcurrentIncomingRequestKiB

func (opts OptionsConfiguration) MaxConcurrentIncomingRequestKiB() int

func (OptionsConfiguration) MaxFolderConcurrency

func (opts OptionsConfiguration) MaxFolderConcurrency() int

func (*OptionsConfiguration) ProtoMessage

func (*OptionsConfiguration) ProtoMessage()

func (*OptionsConfiguration) ProtoSize

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

func (OptionsConfiguration) RequiresRestartOnly

func (opts OptionsConfiguration) RequiresRestartOnly() OptionsConfiguration

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

func (*OptionsConfiguration) Reset

func (m *OptionsConfiguration) Reset()

func (*OptionsConfiguration) String

func (m *OptionsConfiguration) String() string

func (OptionsConfiguration) StunServers

func (opts OptionsConfiguration) StunServers() []string

func (*OptionsConfiguration) Unmarshal

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

func (*OptionsConfiguration) XXX_DiscardUnknown

func (m *OptionsConfiguration) XXX_DiscardUnknown()

func (*OptionsConfiguration) XXX_Marshal

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

func (*OptionsConfiguration) XXX_Merge

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

func (*OptionsConfiguration) XXX_Size

func (m *OptionsConfiguration) XXX_Size() int

func (*OptionsConfiguration) XXX_Unmarshal

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

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

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

func ParseSize(s string) (Size, error)

func (Size) BaseValue

func (s Size) BaseValue() float64

func (*Size) Descriptor

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

func (*Size) Marshal

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

func (*Size) MarshalTo

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

func (*Size) MarshalToSizedBuffer

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

func (*Size) ParseDefault

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

func (Size) Percentage

func (s Size) Percentage() bool

func (*Size) ProtoMessage

func (*Size) ProtoMessage()

func (*Size) ProtoSize

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

func (*Size) Reset

func (m *Size) Reset()

func (Size) String

func (s Size) String() string

func (*Size) Unmarshal

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

func (*Size) XXX_DiscardUnknown

func (m *Size) XXX_DiscardUnknown()

func (*Size) XXX_Marshal

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

func (*Size) XXX_Merge

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

func (*Size) XXX_Size

func (m *Size) XXX_Size() int

func (*Size) XXX_Unmarshal

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

type Tuning

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

func (Tuning) EnumDescriptor

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

func (Tuning) MarshalText

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

func (Tuning) String

func (t Tuning) String() string

func (*Tuning) UnmarshalText

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

type Verifier

type Verifier interface {
	VerifyConfiguration(from, to Configuration) error
}

A Verifier can determine if a new configuration is acceptable. See the description for Committer, above.

type VersioningConfiguration

type VersioningConfiguration struct {
	Type             string            `protobuf:"bytes,1,opt,name=type,proto3" json:"type" xml:"type,attr"`
	Params           map[string]string `` /* 163-byte string literal not displayed */
	CleanupIntervalS int               `` /* 151-byte string literal not displayed */
	FSPath           string            `protobuf:"bytes,4,opt,name=fs_path,json=fsPath,proto3" json:"fsPath" xml:"fsPath"`
	FSType           fs.FilesystemType `protobuf:"varint,5,opt,name=fs_type,json=fsType,proto3,enum=fs.FilesystemType" json:"fsType" xml:"fsType"`
}

VersioningConfiguration is used in the code and for JSON serialization

func (VersioningConfiguration) Copy

func (*VersioningConfiguration) Descriptor

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

func (*VersioningConfiguration) Marshal

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

func (*VersioningConfiguration) MarshalTo

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

func (*VersioningConfiguration) MarshalToSizedBuffer

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

func (*VersioningConfiguration) ProtoMessage()

func (*VersioningConfiguration) ProtoSize

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

func (*VersioningConfiguration) Reset

func (m *VersioningConfiguration) Reset()

func (*VersioningConfiguration) String

func (m *VersioningConfiguration) String() string

func (*VersioningConfiguration) Unmarshal

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

func (*VersioningConfiguration) UnmarshalJSON

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

func (m *VersioningConfiguration) XXX_DiscardUnknown()

func (*VersioningConfiguration) XXX_Marshal

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

func (*VersioningConfiguration) XXX_Merge

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

func (*VersioningConfiguration) XXX_Size

func (m *VersioningConfiguration) XXX_Size() int

func (*VersioningConfiguration) XXX_Unmarshal

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

type Waiter

type Waiter interface {
	Wait()
}

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

type Wrapper

type Wrapper interface {
	ConfigPath() string
	MyID() protocol.DeviceID

	RawCopy() Configuration
	RequiresRestart() bool
	Save() error

	Modify(ModifyFunction) (Waiter, error)
	RemoveFolder(id string) (Waiter, error)
	RemoveDevice(id protocol.DeviceID) (Waiter, error)

	GUI() GUIConfiguration
	LDAP() LDAPConfiguration
	Options() OptionsConfiguration
	DefaultIgnores() Ignores

	Folder(id string) (FolderConfiguration, bool)
	Folders() map[string]FolderConfiguration
	FolderList() []FolderConfiguration
	FolderPasswords(device protocol.DeviceID) map[string]string
	DefaultFolder() FolderConfiguration

	Device(id protocol.DeviceID) (DeviceConfiguration, bool)
	Devices() map[protocol.DeviceID]DeviceConfiguration
	DeviceList() []DeviceConfiguration
	DefaultDevice() DeviceConfiguration

	IgnoredDevices() []ObservedDevice
	IgnoredDevice(id protocol.DeviceID) bool
	IgnoredFolder(device protocol.DeviceID, folder string) bool

	Subscribe(c Committer) Configuration
	Unsubscribe(c Committer)

	suture.Service
}

Wrapper handles a Configuration, i.e. it provides methods to access, change and save the config, and notifies registered subscribers (Committer) of changes.

Modify allows changing the currently active configuration through the given ModifyFunction. It can be called concurrently: All calls will be queued and called in order.

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. The returned Wrapper is a suture.Service, thus needs to be started (added to a supervisor).

func Wrap

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

Wrap wraps an existing Configuration structure and ties it to a file on disk. The returned Wrapper is a suture.Service, thus needs to be started (added to a supervisor).

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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