allocdir

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2015 License: MPL-2.0 Imports: 10 Imported by: 422

Documentation

Overview

Functions shared between linux/darwin.

Index

Constants

This section is empty.

Variables

View Source
var (
	// The name of the directory that is shared across tasks in a task group.
	SharedAllocName = "alloc"

	// The set of directories that exist inside eache shared alloc directory.
	SharedAllocDirs = []string{"logs", "tmp", "data"}

	// The name of the directory that exists inside each task directory
	// regardless of driver.
	TaskLocal = "local"
)

Functions

This section is empty.

Types

type AllocDir

type AllocDir struct {
	// AllocDir is the directory used for storing any state
	// of this allocation. It will be purged on alloc destroy.
	AllocDir string

	// The shared directory is available to all tasks within the same task
	// group.
	SharedDir string

	// TaskDirs is a mapping of task names to their non-shared directory.
	TaskDirs map[string]string
	// contains filtered or unexported fields
}

func NewAllocDir

func NewAllocDir(allocDir string) *AllocDir

func (*AllocDir) Build

func (d *AllocDir) Build(tasks []*structs.Task) error

Given a list of a task build the correct alloc structure.

func (*AllocDir) Destroy

func (d *AllocDir) Destroy() error

Tears down previously build directory structure.

func (*AllocDir) Embed

func (d *AllocDir) Embed(task string, entries map[string]string) error

Embed takes a mapping of absolute directory or file paths on the host to their intended, relative location within the task directory. Embed attempts hardlink and then defaults to copying. If the path exists on the host and can't be embeded an error is returned.

func (*AllocDir) MountSharedDir

func (d *AllocDir) MountSharedDir(task string) error

MountSharedDir mounts the shared directory into the specified task's directory. Mount is documented at an OS level in their respective implementation files.

Jump to

Keyboard shortcuts

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