stagingdir

package
v0.0.0-...-119448c Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type D

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

D manages a staging directory.

While D is active, it resides in a temporary location. Once finished, D can either be committed or destroyed.A On comit, it is atomically moved into its destination; on destroy, it is deleted along with all of its contents.

func New

func New(tempDir, prefix string) (*D, error)

New creates a new staging directory underneath of tempDir.

The directory will be created with the specified prefix.

func (*D) Commit

func (sd *D) Commit(dest string) error

Commit finalizes the staging directory, atomically moving it to path.

func (*D) Destroy

func (sd *D) Destroy() error

Destroy purges the staging directory and its contents.

func (*D) Path

func (sd *D) Path(first string, components ...string) string

Path builds a path relative to the staging directory from the provided compoennts.

Jump to

Keyboard shortcuts

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