sync

package
v2.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveBuilder added in v2.20.3

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

func NewArchiveBuilder added in v2.20.3

func NewArchiveBuilder(writer io.Writer) *ArchiveBuilder

func (*ArchiveBuilder) ArchivePathsIfExist added in v2.20.3

func (a *ArchiveBuilder) ArchivePathsIfExist(paths []PathMapping) error

ArchivePathsIfExist creates a tar archive of all local files in `paths`. It quietly skips any paths that don't exist.

func (*ArchiveBuilder) Close added in v2.20.3

func (a *ArchiveBuilder) Close() error

type LowLevelClient added in v2.20.3

type LowLevelClient interface {
	ContainersForService(ctx context.Context, projectName string, serviceName string) ([]moby.Container, error)

	Exec(ctx context.Context, containerID string, cmd []string, in io.Reader) error
	Untar(ctx context.Context, id string, reader io.ReadCloser) error
}

type PathMapping

type PathMapping struct {
	// 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
}

type Tar added in v2.20.3

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

func NewTar added in v2.20.3

func NewTar(projectName string, client LowLevelClient) *Tar

func (*Tar) Sync added in v2.20.3

func (t *Tar) 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