Documentation
¶
Index ¶
- func DefaultConfig(path string, myID protocol.DeviceID, evLogger events.Logger, ...) (config.Wrapper, error)
- func EnsureDir(dir string, mode fs.FileMode) error
- func GenerateCertificate(certFile, keyFile string) (tls.Certificate, error)
- func LoadConfigAtStartup(path string, cert tls.Certificate, evLogger events.Logger, ...) (config.Wrapper, error)
- func LoadOrGenerateCertificate(certFile, keyFile string) (tls.Certificate, error)
- func OpenDBBackend(path string, tuning config.Tuning) (backend.Backend, error)
- type App
- type Internals
- func (m *Internals) BlockAvailability(folderID string, file protocol.FileInfo, block protocol.BlockInfo) ([]model.Availability, error)
- func (m *Internals) Completion(deviceID protocol.DeviceID, folderID string) (model.FolderCompletion, error)
- func (m *Internals) DBSnapshot(folderID string) (*db.Snapshot, error)
- func (m *Internals) DeviceStatistics() (map[protocol.DeviceID]stats.DeviceStatistics, error)
- func (m *Internals) DownloadBlock(ctx context.Context, deviceID protocol.DeviceID, folderID string, path string, ...) ([]byte, error)
- func (m *Internals) FolderProgressBytesCompleted(folder string) int64
- func (m *Internals) FolderState(folderID string) (string, time.Time, error)
- func (m *Internals) GlobalFileInfo(folderID, path string) (protocol.FileInfo, bool, error)
- func (m *Internals) GlobalTree(folderID string, prefix string, levels int, returnOnlyDirectories bool) ([]*model.TreeEntry, error)
- func (m *Internals) Ignores(folderID string) ([]string, []string, error)
- func (m *Internals) IsConnectedTo(deviceID protocol.DeviceID) bool
- func (m *Internals) LocalChangedFolderFiles(folder string, page, perpage int) ([]protocol.FileInfo, error)
- func (m *Internals) NeedFolderFiles(folder string, page, perpage int) ([]protocol.FileInfo, []protocol.FileInfo, []protocol.FileInfo, error)
- func (m *Internals) PendingFolders(deviceID protocol.DeviceID) (map[string]db.PendingFolder, error)
- func (m *Internals) RemoteNeedFolderFiles(folder string, device protocol.DeviceID, page, perpage int) ([]protocol.FileInfo, error)
- func (m *Internals) ScanFolderSubdirs(folderID string, paths []string) error
- func (m *Internals) ScanFolders() map[string]error
- func (m *Internals) SetIgnores(folderID string, content []string) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶ added in v1.2.2
func GenerateCertificate ¶ added in v1.18.5
func GenerateCertificate(certFile, keyFile string) (tls.Certificate, error)
func LoadConfigAtStartup ¶ added in v1.2.2
func LoadConfigAtStartup(path string, cert tls.Certificate, evLogger events.Logger, allowNewerConfig, noDefaultFolder, skipPortProbing bool) (config.Wrapper, error)
LoadConfigAtStartup loads an existing config. If it doesn't yet exist, it creates a default one, without the default folder if noDefaultFolder is true. Otherwise it checks the version, and archives and upgrades the config if necessary or returns an error, if the version isn't compatible.
func LoadOrGenerateCertificate ¶ added in v1.2.2
func LoadOrGenerateCertificate(certFile, keyFile string) (tls.Certificate, error)
Types ¶
type App ¶
type App struct {
// Access to internals for direct users of this package. Note that the interface in Internals is unstable!
Internals *Internals
// contains filtered or unexported fields
}
func (*App) Error ¶
Error returns an error if one occurred while running the app. It does not wait for the app to stop before returning.
func (*App) Start ¶
Start executes the app and returns once all the startup operations are done, e.g. the API is ready for use. Must be called once only.
func (*App) Stop ¶
func (a *App) Stop(stopReason svcutil.ExitStatus) svcutil.ExitStatus
Stop stops the app and sets its exit status to given reason, unless the app was already stopped before. In any case it returns the effective exit status.
func (*App) Wait ¶
func (a *App) Wait() svcutil.ExitStatus
Wait blocks until the app stops running. Also returns if the app hasn't been started yet.
type Internals ¶ added in v1.27.11
type Internals struct {
// contains filtered or unexported fields
}
Internals allows access to a subset of functionality in model.Model. While intended for use from applications that import the package, it is not intended as a stable API at this time. It does however provide a boundary between the more volatile Model interface and upstream users (one of which is an iOS app).
func (*Internals) BlockAvailability ¶ added in v1.27.11
func (*Internals) Completion ¶ added in v1.27.11
func (*Internals) DBSnapshot ¶ added in v1.27.11
func (*Internals) DeviceStatistics ¶ added in v1.27.11
func (*Internals) DownloadBlock ¶ added in v1.27.11
func (*Internals) FolderProgressBytesCompleted ¶ added in v1.29.6
func (*Internals) FolderState ¶ added in v1.27.11
func (*Internals) GlobalFileInfo ¶ added in v1.27.11
func (*Internals) GlobalTree ¶ added in v1.27.11
func (*Internals) IsConnectedTo ¶ added in v1.27.11
func (*Internals) LocalChangedFolderFiles ¶ added in v1.29.6
func (*Internals) NeedFolderFiles ¶ added in v1.29.6
func (m *Internals) NeedFolderFiles(folder string, page, perpage int) ([]protocol.FileInfo, []protocol.FileInfo, []protocol.FileInfo, error)
NeedFolderFiles returns paginated list of currently needed files in progress, queued, and to be queued on next puller iteration.