Documentation ¶
Overview ¶
Package config implements reading and writing of the syncthing configuration file.
Index ¶
- func ChangeRequiresRestart(from, to Configuration) bool
- type Configuration
- func (cfg *Configuration) GetNodeConfiguration(nodeID protocol.NodeID) *NodeConfiguration
- func (cfg *Configuration) GetRepoConfiguration(repoID string) *RepositoryConfiguration
- func (cfg *Configuration) NodeMap() map[protocol.NodeID]NodeConfiguration
- func (cfg *Configuration) RepoMap() map[string]RepositoryConfiguration
- func (cfg *Configuration) Save() error
- type GUIConfiguration
- type InternalParam
- type InternalVersioningConfiguration
- type NodeConfiguration
- type NodeConfigurationList
- type OptionsConfiguration
- type RepositoryConfiguration
- type RepositoryNodeConfiguration
- type RepositoryNodeConfigurationList
- type VersioningConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeRequiresRestart ¶ added in v0.9.18
func ChangeRequiresRestart(from, to Configuration) bool
ChangeRequiresRestart returns true if updating the configuration requires a complete restart.
Types ¶
type Configuration ¶
type Configuration struct { Location string `xml:"-" json:"-"` Version int `xml:"version,attr" default:"3"` Repositories []RepositoryConfiguration `xml:"repository"` Nodes []NodeConfiguration `xml:"node"` GUI GUIConfiguration `xml:"gui"` Options OptionsConfiguration `xml:"options"` XMLName xml.Name `xml:"configuration" json:"-"` }
func (*Configuration) GetNodeConfiguration ¶ added in v0.9.5
func (cfg *Configuration) GetNodeConfiguration(nodeID protocol.NodeID) *NodeConfiguration
func (*Configuration) GetRepoConfiguration ¶ added in v0.9.18
func (cfg *Configuration) GetRepoConfiguration(repoID string) *RepositoryConfiguration
func (*Configuration) NodeMap ¶ added in v0.8.14
func (cfg *Configuration) NodeMap() map[protocol.NodeID]NodeConfiguration
func (*Configuration) RepoMap ¶ added in v0.8.14
func (cfg *Configuration) RepoMap() map[string]RepositoryConfiguration
func (*Configuration) Save ¶ added in v0.9.14
func (cfg *Configuration) Save() error
type GUIConfiguration ¶
type InternalParam ¶ added in v0.8.10
type InternalVersioningConfiguration ¶ added in v0.8.10
type InternalVersioningConfiguration struct { Type string `xml:"type,attr,omitempty"` Params []InternalParam `xml:"param"` }
type NodeConfiguration ¶
type NodeConfigurationList ¶
type NodeConfigurationList []NodeConfiguration
func (NodeConfigurationList) Len ¶
func (l NodeConfigurationList) Len() int
func (NodeConfigurationList) Less ¶
func (l NodeConfigurationList) Less(a, b int) bool
func (NodeConfigurationList) Swap ¶
func (l NodeConfigurationList) Swap(a, b int)
type OptionsConfiguration ¶
type OptionsConfiguration struct { ListenAddress []string `xml:"listenAddress" default:"0.0.0.0:22000"` GlobalAnnServer string `xml:"globalAnnounceServer" default:"announce.syncthing.net:22026"` GlobalAnnEnabled bool `xml:"globalAnnounceEnabled" default:"true"` LocalAnnEnabled bool `xml:"localAnnounceEnabled" default:"true"` LocalAnnPort int `xml:"localAnnouncePort" default:"21025"` LocalAnnMCAddr string `xml:"localAnnounceMCAddr" default:"[ff32::5222]:21026"` ParallelRequests int `xml:"parallelRequests" default:"16"` MaxSendKbps int `xml:"maxSendKbps"` MaxRecvKbps int `xml:"maxRecvKbps"` ReconnectIntervalS int `xml:"reconnectionIntervalS" default:"60"` StartBrowser bool `xml:"startBrowser" default:"true"` UPnPEnabled bool `xml:"upnpEnabled" default:"true"` UPnPLease int `xml:"upnpLeaseMinutes" default:"0"` UPnPRenewal int `xml:"upnpRenewalMinutes" default:"30"` URAccepted int `xml:"urAccepted"` // Accepted usage reporting version; 0 for off (undecided), -1 for off (permanently) RestartOnWakeup bool `xml:"restartOnWakeup" default:"true"` Deprecated_RescanIntervalS int `xml:"rescanIntervalS,omitempty" json:"-"` Deprecated_UREnabled bool `xml:"urEnabled,omitempty" json:"-"` Deprecated_URDeclined bool `xml:"urDeclined,omitempty" json:"-"` Deprecated_ReadOnly bool `xml:"readOnly,omitempty" json:"-"` Deprecated_GUIEnabled bool `xml:"guiEnabled,omitempty" json:"-"` Deprecated_GUIAddress string `xml:"guiAddress,omitempty" json:"-"` }
type RepositoryConfiguration ¶
type RepositoryConfiguration struct { ID string `xml:"id,attr"` Directory string `xml:"directory,attr"` Nodes []RepositoryNodeConfiguration `xml:"node"` ReadOnly bool `xml:"ro,attr"` RescanIntervalS int `xml:"rescanIntervalS,attr" default:"60"` IgnorePerms bool `xml:"ignorePerms,attr"` Invalid string `xml:"-"` // Set at runtime when there is an error, not saved Versioning VersioningConfiguration `xml:"versioning"` // contains filtered or unexported fields }
func (*RepositoryConfiguration) NodeIDs ¶
func (r *RepositoryConfiguration) NodeIDs() []protocol.NodeID
type RepositoryNodeConfiguration ¶ added in v0.9.6
type RepositoryNodeConfigurationList ¶ added in v0.9.6
type RepositoryNodeConfigurationList []RepositoryNodeConfiguration
func (RepositoryNodeConfigurationList) Len ¶ added in v0.9.6
func (l RepositoryNodeConfigurationList) Len() int
func (RepositoryNodeConfigurationList) Less ¶ added in v0.9.6
func (l RepositoryNodeConfigurationList) Less(a, b int) bool
func (RepositoryNodeConfigurationList) Swap ¶ added in v0.9.6
func (l RepositoryNodeConfigurationList) Swap(a, b int)
type VersioningConfiguration ¶ added in v0.8.10
func (*VersioningConfiguration) MarshalXML ¶ added in v0.8.10
func (c *VersioningConfiguration) MarshalXML(e *xml.Encoder, start xml.StartElement) error
func (*VersioningConfiguration) UnmarshalXML ¶ added in v0.8.10
func (c *VersioningConfiguration) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
Click to show internal directories.
Click to hide internal directories.