{"modulePath":"cdr.dev/coder-cli","version":"v1.39.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sync\n\nPackage sync contains logic for establishing a file sync between a local machine and a Coder workspace.\n\n## Variables\n\n```go\nvar ErrRestartSync = errors.New(\"the sync exited because it was overloaded, restart it\")\n```\nErrRestartSync describes a known error case that can be solved by re-starting the command.\n\n## Functions\n\n```go\nfunc SingleFile(ctx context.Context, local, remoteDir string, workspace *coder.Workspace, client coder.Client) error\n```\nSingleFile copies the given file into the remote dir or remote path of the given coder.Workspace.\n\n## Types\n\n```go\ntype Sync struct {\n\t// Init sets whether the sync will do the initial init and then return fast.\n\tInit bool\n\t// LocalDir is an absolute path.\n\tLocalDir string\n\t// RemoteDir is an absolute path.\n\tRemoteDir string\n\t// DisableMetrics disables activity metric pushing.\n\tDisableMetrics bool\n\n\tWorkspace           coder.Workspace\n\tClient              coder.Client\n\tOutW                io.Writer\n\tErrW                io.Writer\n\tInputReader         io.Reader\n\tIsInteractiveOutput bool\n}\n```\nSync runs a live sync daemon.\n\n```go\nfunc (s Sync) Run() error\n```\nRun starts the sync synchronously. Use this command to debug what wasn't sync'd correctly: rsync -e \"coder sh\" -nicr ~/Projects/cdr/coder-cli/. ammar:/home/coder/coder-cli/.\n\n```go\nfunc (s Sync) Version() (string, error)\n```\nVersion returns remote protocol version as a string. Or, an error if one exists.\n\n","path":"cdr.dev/coder-cli/internal/sync","name":"sync","synopsis":"Package sync contains logic for establishing a file sync between a local machine and a Coder workspace.","isRedistributable":true}
