Documentation
¶
Overview ¶
Package syncthingtest is an httptest stand-in for Syncthing's REST API: the endpoints the two adapters call, keyed by X-API-Key, keeping what they post. It is a test helper and nothing ships it.
Index ¶
Constants ¶
View Source
const ID = "SELFSEL-FSELFSE-LFSELFS-ELFSELF-SELFSEL-FSELFSE-LFSELFS-ELFSELF"
ID is the device id the fake answers as myID.
View Source
const Key = "fixture-api-key-7f3a"
Key is the API key the fixtures write into config.xml. Every test that runs a verb asserts it never reaches stdout or stderr.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fake ¶
type Fake struct {
T *testing.T
Mu sync.Mutex
Devices []syncthing.DeviceConfig
DevicePosts int
Folders []syncthing.FolderConfig
// FolderPosts counts POST /rest/config/folders.
FolderPosts int
// Pauses counts the PATCHes that paused a folder.
Pauses int
// Deletes is the folder ids DELETEd, in order.
Deletes []string
// FailDelete makes a folder DELETE answer 500.
FailDelete bool
// DeleteTries counts every folder DELETE, refused or not.
DeleteTries int
// Extra is the folders "another project" holds: listed, never posted.
Extra []syncthing.ConfiguredFolder
Connected map[string]bool
// Listen is options.listenAddresses; ListenSets counts its PATCHes.
Listen []string
ListenSets int
Shutdowns int
FailStop bool
OnShutdown func()
BadKey int
}
A Fake is the server's state. A test reads and writes it under Mu.
func (*Fake) FolderDevices ¶
FolderDevices answers the device ids of one configured folder, or nil when it is not configured.
Click to show internal directories.
Click to hide internal directories.