workspace

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilePredicate

type FilePredicate func(string) bool

type Workspace

type Workspace interface {
	// GetPath returns the path to the workspace directory.
	GetPath() string

	// FileFromUpload copies the contents of the given input stream into a new
	// file with the given name in the workspace directory.
	FileFromUpload(name string, in io.Reader) (*os.File, error)

	// Files returns a list of file names matching the given predicate
	// representing files in the workspace.
	Files(FilePredicate) ([]string, error)

	// Open the workspace file with the given name.
	Open(name string) (*os.File, error)

	// Delete the workspace file with the given name.
	Delete(name string) error

	// Stat returns the file info for the workspace file with the given name.
	Stat(name string) (os.FileInfo, error)
}

func Create

func Create(dir string, log *logrus.Entry) (Workspace, error)

Create returns a new Workspace instance rooted in the given directory path.

Jump to

Keyboard shortcuts

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