Documentation ¶
Index ¶
- Constants
- func ArgsToMap(args []string) map[string]string
- func MakeMarkers(folders map[string]string) error
- func MakeServer(folders map[string]string) string
- func MapToArgs(m map[string]string) []string
- type APIClient
- func (api APIClient) GetCompletion(folder, device string) (completion Completion, err error)
- func (api APIClient) GetConnections() (conns Connections, err error)
- func (api APIClient) GetStatus(folder string) (status Status, err error)
- func (api APIClient) OverrideVersion(folder string) error
- func (api APIClient) Ping() error
- func (api APIClient) Reset() error
- func (api APIClient) Restart() error
- type BindVolume
- type Client
- type Completion
- type Connection
- type Connections
- type Mount
- type Status
Constants ¶
const ( ProgressPending progressPhase = iota ProgressDone ProgressError )
const ( Marker = ".blimp_syncthing" // I don't want to use the standard syncthing port, in case one of our users // wants to run syncthing in docker compose. It doesn't look like anything // actually uses this port so we should be good w.r.t. conflicts. The "right" // thing to do, would be to use a unix socket in the CLI, and then conflicts // aren't possible. Port = 22022 APIPort = 8384 TunneledAPIPort = 8385 CLIDeviceID = "ROHA7NN-4KWKQ3Q-CHJMZBK-6UD7Z6D-ZTWQR5C-TYLN6WG-Q2EQJAI-JU73EQN" RemoteDeviceID = "K6QHA3P-VGHXBZE-2NILDY3-Y4E2EUU-7DCSOVF-DFVCQRM-P5BVGMB-LDLP6QA" )
Variables ¶
This section is empty.
Functions ¶
func MakeMarkers ¶
func MakeServer ¶
Types ¶
type APIClient ¶
type APIClient struct {
Address string
}
func (APIClient) GetCompletion ¶
func (api APIClient) GetCompletion(folder, device string) (completion Completion, err error)
func (APIClient) GetConnections ¶
func (api APIClient) GetConnections() (conns Connections, err error)
func (APIClient) OverrideVersion ¶
type BindVolume ¶
BindVolume represents a bind volume used by a single service, along with any subdirectories that are masked off by native volumes mounted into this service.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(volumes []BindVolume) Client
func (Client) GetIDPathMap ¶
type Completion ¶
type Connection ¶
type Connection struct {
Connected bool `json:"connected"`
}
type Connections ¶
type Connections struct {
Connections map[string]Connection `json:"connections"`
}
type Mount ¶
type Mount struct { Path string // Include should only be set if Ignore is nil and SyncAll is false. Include []string // Ignore overrides SyncAll for specific files or directories. Ignore should // only be set if Include is nil and SyncAll is true. Ignore []string SyncAll bool }
func (Mount) GetStignore ¶
GetStignore returns the stignore file needed to include only the paths in `Mount.Include`. In order to sync subdirectories, we have to add explicit rules allowing each parent directory, and ignoring all other files in the parent directory. For example, to sync the directory /foo/bar/, we have to use a stignore of the form: ``` !/foo/bar # Include the target directory. /foo/ # Exclude all other files in /foo, but not /foo itself. !/foo # Include /foo. ``` If we didn't have the latter two rules, /foo/bar wouldn't get synced, since the directory /foo would never get created. See this issue for more information: https://github.com/syncthing/syncthing/issues/2091.