sync

package
v1.27.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2022 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package sync contains logic for establishing a file sync between a local machine and a Coder workspace.

Index

Constants

This section is empty.

Variables

View Source
var ErrRestartSync = errors.New("the sync exited because it was overloaded, restart it")

ErrRestartSync describes a known error case that can be solved by re-starting the command.

Functions

func SingleFile added in v1.12.1

func SingleFile(ctx context.Context, local, remoteDir string, workspace *coder.Workspace, client coder.Client) error

SingleFile copies the given file into the remote dir or remote path of the given coder.Workspace.

Types

type Sync

type Sync struct {
	// Init sets whether the sync will do the initial init and then return fast.
	Init bool
	// LocalDir is an absolute path.
	LocalDir string
	// RemoteDir is an absolute path.
	RemoteDir string
	// DisableMetrics disables activity metric pushing.
	DisableMetrics bool

	Workspace           coder.Workspace
	Client              coder.Client
	OutW                io.Writer
	ErrW                io.Writer
	InputReader         io.Reader
	IsInteractiveOutput bool
}

Sync runs a live sync daemon.

func (Sync) Run

func (s Sync) Run() error

Run 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/.

func (Sync) Version added in v1.9.0

func (s Sync) Version() (string, error)

Version returns remote protocol version as a string. Or, an error if one exists.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL