drive

package
v1.1.0-RC1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package drive provides the definitions for the low-level pfs storage drivers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPermissionError added in v1.1.0

func IsPermissionError(err error) bool

IsPermissionError returns true if a given error is a permission error.

Types

type CommitID

type CommitID string // master/0

CommitID is an alias for string

type Driver

type Driver interface {
	CreateRepo(repo *pfs.Repo, provenance []*pfs.Repo) error
	InspectRepo(repo *pfs.Repo) (*pfs.RepoInfo, error)
	ListRepo(provenance []*pfs.Repo) ([]*pfs.RepoInfo, error)
	DeleteRepo(repo *pfs.Repo, force bool) error
	StartCommit(repo *pfs.Repo, commitID string, parentID string, branch string, started *google_protobuf.Timestamp, provenance []*pfs.Commit) (*pfs.Commit, error)
	FinishCommit(commit *pfs.Commit, finished *google_protobuf.Timestamp, cancel bool) error
	ArchiveCommit(commit []*pfs.Commit) error
	InspectCommit(commit *pfs.Commit) (*pfs.CommitInfo, error)
	ListCommit(repo []*pfs.Repo, commitType pfs.CommitType, fromCommit []*pfs.Commit,
		provenance []*pfs.Commit, status pfs.CommitStatus, block bool) ([]*pfs.CommitInfo, error)
	FlushCommit(fromCommits []*pfs.Commit, toRepos []*pfs.Repo) ([]*pfs.CommitInfo, error)
	ListBranch(repo *pfs.Repo) ([]*pfs.CommitInfo, error)
	DeleteCommit(commit *pfs.Commit) error
	PutFile(file *pfs.File, delimiter pfs.Delimiter, reader io.Reader) error
	MakeDirectory(file *pfs.File) error
	GetFile(file *pfs.File, filterShard *pfs.Shard, offset int64,
		size int64, diffMethod *pfs.DiffMethod) (io.ReadCloser, error)
	InspectFile(file *pfs.File, filterShard *pfs.Shard, diffMethod *pfs.DiffMethod) (*pfs.FileInfo, error)
	ListFile(file *pfs.File, filterShard *pfs.Shard, diffMethod *pfs.DiffMethod, recurse bool) ([]*pfs.FileInfo, error)
	DeleteFile(file *pfs.File) error
	DeleteAll() error
	ArchiveAll() error
	Dump()
	// If strategy is SQUASH, to is the ID of an open commit
	// If strategy is REPLAY, to is a branch name
	Merge(repo *pfs.Repo, commits []*pfs.Commit, to string, strategy pfs.MergeStrategy, cancel bool) (*pfs.Commits, error)
}

Driver represents a low-level pfs storage driver.

type PfsRefactorDriver

type PfsRefactorDriver interface {
	CreateRepo(repo *pfs.Repo, provenance []*pfs.Repo) error
	InspectRepo(repo *pfs.Repo) (*pfs.RepoInfo, error)
	ListRepo(provenance []*pfs.Repo) ([]*pfs.RepoInfo, error)
	DeleteRepo(repo *pfs.Repo, force bool) error
	StartCommit(repo *pfs.Repo, branch string, provenance []*pfs.Commit) (CommitID, error)
	StartCommitNewBranch(repo *pfs.Repo, parentID string, branch string, provenance []*pfs.Commit) (CommitID, error)
	FinishCommit(commit CommitID, cancel bool) error
	ArchiveCommit(commit CommitID) error
	InspectCommit(commit CommitID) (*pfs.CommitInfo, error)
	ListCommit(repo *pfs.Repo, branch string, commitType pfs.CommitType, fromCommit *pfs.Commit, provenance []*pfs.Commit, all bool) ([]*pfs.CommitInfo, error)
	FlushCommit(fromCommits []*pfs.Commit, toRepos []*pfs.Repo) ([]*pfs.CommitInfo, error)
	ListBranch(repo *pfs.Repo) ([]string, error)
	DeleteCommit(commit CommitID) error
	PutFile(file *pfs.File, delimiter pfs.Delimiter, reader io.Reader) error
	MakeDirectory(file *pfs.File) error
	GetFile(file *pfs.File, filterShard *pfs.Shard, offset int64,
		size int64, from CommitID, unsafe bool) (io.ReadCloser, error)
	InspectFile(file *pfs.File, filterShard *pfs.Shard, from CommitID, unsafe bool) (*pfs.FileInfo, error)
	ListFile(file *pfs.File, filterShard *pfs.Shard, from CommitID, recurse bool, unsafe bool) ([]*pfs.FileInfo, error)
	DeleteFile(file *pfs.File, unsafe bool) error
	DeleteAll() error
	ArchiveAll() error
	Squash(from []*pfs.Commit, to *pfs.Commit) error
	Merge(repo string, commits []*pfs.Commit, toBranch string, strategy pfs.MergeStrategy) (*pfs.Commits, error)
	Dump()
}

PfsRefactorDriver is only here for documentation purposes, showing how we envision the new PFS API to be like.

Jump to

Keyboard shortcuts

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