sync

package
v2.20.2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComposeClient

type ComposeClient interface {
	Exec(ctx context.Context, projectName string, options api.RunOptions) (int, error)

	Copy(ctx context.Context, projectName string, options api.CopyOptions) error
}

type DockerCopy

type DockerCopy struct {
	// contains filtered or unexported fields
}

func NewDockerCopy

func NewDockerCopy(projectName string, client ComposeClient, infoWriter io.Writer) *DockerCopy

func (*DockerCopy) Sync

func (d *DockerCopy) Sync(ctx context.Context, service types.ServiceConfig, paths []PathMapping) error

type PathMapping

type PathMapping struct {
	// Service that the file event is for.
	Service string
	// HostPath that was created/modified/deleted outside the container.
	//
	// This is the path as seen from the user's perspective, e.g.
	// 	- C:\Users\moby\Documents\hello-world\main.go (file on Windows)
	//  - /Users/moby/Documents/hello-world (directory on macOS)
	HostPath string
	// ContainerPath for the target file inside the container (only populated
	// for sync events, not rebuild).
	//
	// This is the path as used in Docker CLI commands, e.g.
	//	- /workdir/main.go
	//  - /workdir/subdir
	ContainerPath string
}

PathMapping contains the Compose service and modified host system path.

type Syncer

type Syncer interface {
	Sync(ctx context.Context, service types.ServiceConfig, paths []PathMapping) error
}

Jump to

Keyboard shortcuts

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