Documentation
¶
Index ¶
- Constants
- type Configuration
- type FolderConfiguration
- type GUIConfiguration
- type OptionsConfiguration
- type Wrapper
- func (w *Wrapper) AsStCfg(myID protocol.DeviceID) *stconfig.Wrapper
- func (w *Wrapper) ConfigPath() string
- func (w *Wrapper) Devices() map[protocol.DeviceID]stconfig.DeviceConfiguration
- func (w *Wrapper) Folders() map[string]FolderConfiguration
- func (w *Wrapper) MyDeviceConfiguration() stconfig.DeviceConfiguration
- func (w *Wrapper) Raw() Configuration
- func (w *Wrapper) Replace(to Configuration) error
- func (w *Wrapper) Save() error
- func (w *Wrapper) SetDevice(devCfg stconfig.DeviceConfiguration)
- func (w *Wrapper) SetFolder(fldCfg FolderConfiguration)
Constants ¶
View Source
const (
CurrentVersion = 0
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
Version int `xml:"version,attr" json:"version"`
MyID string `xml:"-" json:"myID"`
MountPoint string `xml:"mountPoint" json:"mountPoint"`
Folders []FolderConfiguration `xml:"folder" json:"folders"`
Devices []config.DeviceConfiguration `xml:"device" json:"devices"`
Options OptionsConfiguration `xml:"options" json:"options"`
GUI GUIConfiguration `xml:"gui" json:"gui"`
XMLName xml.Name `xml:"configuration" json:"-"`
}
type FolderConfiguration ¶
type FolderConfiguration struct {
ID string `xml:"id,attr" json:"id"`
Devices []config.FolderDeviceConfiguration `xml:"device" json:"devices"`
CacheSize string `xml:"cacheSize" json:"cacheSize" default:"512MiB"`
PinnedFiles []string `xml:"pinnedFiles" json:"pinnedFiles"`
}
func (FolderConfiguration) GetCacheSizeBytes ¶
func (f FolderConfiguration) GetCacheSizeBytes() (int32, error)
type GUIConfiguration ¶
type OptionsConfiguration ¶
type OptionsConfiguration struct {
ListenAddress []string `xml:"listenAddress" json:"listenAddress" default:"tcp://0.0.0.0:22000"`
LocalAnnounceEnabled bool `xml:"localAnnounceEnabled" json:"localAnnounceEnabled" default:"true"`
LocalAnnouncePort int `xml:"localAnnouncePort" json:"localAnnouncePort" default:"21027"`
LocalAnnounceMCAddr string `xml:"localAnnounceMCAddr" json:"localAnnounceMCAddr"`
GlobalAnnounceEnabled bool `xml:"globalAnnounceEnabled" json:"globalAnnounceEnabled" default:"true"`
GlobalAnnounceServers []string `xml:"globalAnnounceServer" json:"globalAnnounceServers" default:"default"`
RelaysEnabled bool `xml:"relaysEnabled" json:"relaysEnabled" default:"true"`
RelayWithoutGlobalAnnounce bool `xml:"relayWithoutGlobalAnn" json:"relayWithoutGlobalAnn" default:"false"`
RelayServers []string `xml:"relayServer" json:"relayServers" default:"dynamic+https://relays.syncthing.net/endpoint"`
RelayReconnectIntervalM int `xml:"relayReconnectIntervalM" json:"relayReconnectIntervalM" default:"10"`
}
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
func Wrap ¶
func Wrap(path string, cfg Configuration) *Wrapper
Wrap wraps an existing Configuration structure and ties it to a file on disk.
func (*Wrapper) ConfigPath ¶
func (*Wrapper) Devices ¶
func (w *Wrapper) Devices() map[protocol.DeviceID]stconfig.DeviceConfiguration
func (*Wrapper) Folders ¶
func (w *Wrapper) Folders() map[string]FolderConfiguration
Folders returns a map of folders. Folder structures should not be changed, other than for the purpose of updating via SetFolder().
func (*Wrapper) MyDeviceConfiguration ¶
func (w *Wrapper) MyDeviceConfiguration() stconfig.DeviceConfiguration
func (*Wrapper) Raw ¶
func (w *Wrapper) Raw() Configuration
Raw returns the currently wrapped Configuration object.
func (*Wrapper) Replace ¶
func (w *Wrapper) Replace(to Configuration) error
func (*Wrapper) SetDevice ¶
func (w *Wrapper) SetDevice(devCfg stconfig.DeviceConfiguration)
func (*Wrapper) SetFolder ¶
func (w *Wrapper) SetFolder(fldCfg FolderConfiguration)
Click to show internal directories.
Click to hide internal directories.