pfs

package
v2.9.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const GetFileTARSuggestion = "Use GetFileTAR instead"

Variables

View Source
var (
	ErrMatchedNonFile       = fmt.Errorf("cannot get directory or non-regular file. %s", GetFileTARSuggestion)
	ErrMatchedMultipleFiles = fmt.Errorf("matched multiple files. %s", GetFileTARSuggestion)
)

Functions

func IsAmbiguousCommitErr

func IsAmbiguousCommitErr(err error) bool

IsAmbiguousCommitErr returns true if the err is due to attempting to resolve a commit without specifying a branch when it is required to uniquely identify the commit.

func IsBaseCommitNotFinishedErr

func IsBaseCommitNotFinishedErr(err error) bool

func IsBranchNotFoundErr

func IsBranchNotFoundErr(err error) bool

IsBranchNotFoundErr returns true if 'err' is an error message about a branch not being found

func IsCommitDeletedErr

func IsCommitDeletedErr(err error) bool

IsCommitDeletedErr returns true if 'err' has an error message that matches ErrCommitDeleted

func IsCommitErrorErr

func IsCommitErrorErr(err error) bool

IsCommitError returns true of 'err' has an error message that matches ErrCommitError

func IsCommitFinishedErr

func IsCommitFinishedErr(err error) bool

IsCommitFinishedErr returns true of 'err' has an error message that matches ErrCommitFinished

func IsCommitNotFinishedErr

func IsCommitNotFinishedErr(err error) bool

IsCommitNotFinishedErr returns true if the err is due to an attempt at performing an operation that only applies to finished commits on an unfinished commit.

func IsCommitNotFoundErr

func IsCommitNotFoundErr(err error) bool

IsCommitNotFoundErr returns true if 'err' has an error message that matches ErrCommitNotFound

func IsCommitOnOutputBranchErr

func IsCommitOnOutputBranchErr(err error) bool

IsCommitOnOutputBranchErr returns true if the err is due to an attempt to start a commit on an output branch.

func IsCommitSetNotFoundErr

func IsCommitSetNotFoundErr(err error) bool

IsCommitSetNotFoundErr returns true if 'err' has an error message that matches ErrCommitSetNotFound

func IsDropWithChildrenErr

func IsDropWithChildrenErr(err error) bool

func IsFileNotFoundErr

func IsFileNotFoundErr(err error) bool

IsFileNotFoundErr returns true if 'err' is an error message about a PFS file not being found

func IsInconsistentCommitErr

func IsInconsistentCommitErr(err error) bool

IsInconsistentCommitErr returns true if the err is due to an attempt to have multiple commits in a single branch within a transaction.

func IsInvalidBranchStructureErr

func IsInvalidBranchStructureErr(err error) bool

func IsOutputCommitNotFinishedErr

func IsOutputCommitNotFinishedErr(err error) bool

IsOutputCommitNotFinishedErr returns true if the err is due to an operation that cannot be performed on an unfinished output commit

func IsRepoExistsErr

func IsRepoExistsErr(err error) bool

IsRepoExistsErr returns true if 'err' is an error message about a repo existing

func IsRepoNotFoundErr

func IsRepoNotFoundErr(err error) bool

IsRepoNotFoundErr returns true if 'err' is an error message about a repo not being found

func IsSquashWithSuvenanceErr

func IsSquashWithSuvenanceErr(err error) bool

func IsSquashWithoutChildrenErr

func IsSquashWithoutChildrenErr(err error) bool

func ValidateSQLDatabaseEgress

func ValidateSQLDatabaseEgress(sql *pfs.SQLDatabaseEgress) error

Types

type APIServer

type APIServer interface {
	pfs_client.APIServer

	NewPropagater(*txncontext.TransactionContext) txncontext.PfsPropagater

	CreateRepoInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.CreateRepoRequest) error
	InspectRepoInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.InspectRepoRequest) (*pfs_client.RepoInfo, error)
	DeleteRepoInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.DeleteRepoRequest) (bool, error)
	DeleteReposInTransaction(context.Context, *txncontext.TransactionContext, []*pfs_client.Repo, bool) error

	StartCommitInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.StartCommitRequest) (*pfs_client.Commit, error)
	FinishCommitInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.FinishCommitRequest) error
	InspectCommitInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.InspectCommitRequest) (*pfs_client.CommitInfo, error)

	InspectCommitSetInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.CommitSet, bool) ([]*pfs_client.CommitInfo, error)
	SquashCommitSetInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.SquashCommitSetRequest) error

	CreateBranchInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.CreateBranchRequest) error
	InspectBranchInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.InspectBranchRequest) (*pfs_client.BranchInfo, error)
	DeleteBranchInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.DeleteBranchRequest) error

	AddFileSetInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.AddFileSetRequest) error
	ActivateAuthInTransaction(context.Context, *txncontext.TransactionContext, *pfs_client.ActivateAuthRequest) (*pfs_client.ActivateAuthResponse, error)
}

APIServer is the internal interface for other services to call this one. This includes all the public RPC methods and additional internal-only methods for use within pachd. These methods *do not* check that a user is authorized unless otherwise noted.

type ErrBaseCommitNotFinished

type ErrBaseCommitNotFinished struct {
	BaseCommit *pfs.Commit
	Commit     *pfs.Commit
}

ErrBaseCommitNotFinished represents an error where a base commit has not been finished.

func (ErrBaseCommitNotFinished) Error

func (e ErrBaseCommitNotFinished) Error() string

type ErrBranchExists

type ErrBranchExists struct {
	Branch *pfs.Branch
}

ErrBranchExists represents a branch-exists error.

func (ErrBranchExists) Error

func (e ErrBranchExists) Error() string

func (ErrBranchExists) GRPCStatus

func (e ErrBranchExists) GRPCStatus() *status.Status

type ErrBranchNotFound

type ErrBranchNotFound struct {
	Branch *pfs.Branch
}

ErrBranchNotFound represents a branch-not-found error.

func (ErrBranchNotFound) Error

func (e ErrBranchNotFound) Error() string

func (ErrBranchNotFound) GRPCStatus

func (e ErrBranchNotFound) GRPCStatus() *status.Status

type ErrCommitDeleted

type ErrCommitDeleted struct {
	Commit *pfs.Commit
}

ErrCommitDeleted represents an error where the commit has been deleted (e.g. from InspectCommit)

func (ErrCommitDeleted) Error

func (e ErrCommitDeleted) Error() string

type ErrCommitError

type ErrCommitError struct {
	Commit *pfs.Commit
}

ErrCommitError represents an error where the commit has been finished with an error.

func (ErrCommitError) Error

func (e ErrCommitError) Error() string

type ErrCommitExists

type ErrCommitExists struct {
	Commit *pfs.Commit
}

ErrCommitExists represents an error where the commit already exists.

func (ErrCommitExists) Error

func (e ErrCommitExists) Error() string

func (ErrCommitExists) GRPCStatus

func (e ErrCommitExists) GRPCStatus() *status.Status

type ErrCommitFinished

type ErrCommitFinished struct {
	Commit *pfs.Commit
}

ErrCommitFinished represents an error where the commit has been finished (e.g from PutFile or DeleteFile)

func (ErrCommitFinished) Error

func (e ErrCommitFinished) Error() string

type ErrCommitNotFinished

type ErrCommitNotFinished struct {
	Commit *pfs.Commit
}

ErrCommitNotFinished represents an error where the commit has not been finished.

func (ErrCommitNotFinished) Error

func (e ErrCommitNotFinished) Error() string

func (ErrCommitNotFinished) GRPCStatus added in v2.7.0

func (err ErrCommitNotFinished) GRPCStatus() *status.Status

type ErrCommitNotFound

type ErrCommitNotFound struct {
	Commit *pfs.Commit
}

ErrCommitNotFound represents a commit-not-found error.

func (ErrCommitNotFound) Error

func (e ErrCommitNotFound) Error() string

func (ErrCommitNotFound) GRPCStatus

func (e ErrCommitNotFound) GRPCStatus() *status.Status

type ErrCommitOnOutputBranch

type ErrCommitOnOutputBranch struct {
	Branch *pfs.Branch
}

ErrCommitOnOutputBranch represents an error where an attempt was made to start a commit on an output branch (a branch that is provenant on other branches). Users should not manually try to start a commit in an output branch, this should only be done internally in PFS.

func (ErrCommitOnOutputBranch) Error

func (e ErrCommitOnOutputBranch) Error() string

type ErrCommitSetNotFound

type ErrCommitSetNotFound struct {
	CommitSet *pfs.CommitSet
}

ErrCommitSetNotFound represents a commitset-not-found error.

func (ErrCommitSetNotFound) Error

func (e ErrCommitSetNotFound) Error() string

func (ErrCommitSetNotFound) GRPCStatus

func (e ErrCommitSetNotFound) GRPCStatus() *status.Status

type ErrDropWithChildren

type ErrDropWithChildren struct {
	Commit *pfs.Commit
}

ErrDropWithChildren represents an error when attempting to drop a commit that has children. Because proper datum removal semantics have not been implemented in the middle of a commit chain, this operation is unsupported. However, a drop is still allowed for a commit with no children as there is no cleanup needed for child commits.

func (ErrDropWithChildren) Error

func (e ErrDropWithChildren) Error() string

type ErrFileNotFound

type ErrFileNotFound struct {
	File *pfs.File
}

ErrFileNotFound represents a file-not-found error.

func (ErrFileNotFound) Error

func (e ErrFileNotFound) Error() string

func (ErrFileNotFound) GRPCStatus

func (e ErrFileNotFound) GRPCStatus() *status.Status

type ErrInconsistentCommit

type ErrInconsistentCommit struct {
	Commit *pfs.Commit
}

ErrInconsistentCommit represents an error where a transaction attempts to create a CommitSet with multiple commits in the same branch, which would result in inconsistent data dependencies.

func (ErrInconsistentCommit) Error

func (e ErrInconsistentCommit) Error() string

func (ErrInconsistentCommit) Is

func (e ErrInconsistentCommit) Is(other error) bool

type ErrInvalidProvenanceStructure

type ErrInvalidProvenanceStructure struct {
	Branch *pfs.Branch
}

ErrInvalidProvenanceStructure represents an error where more than one branch from a repo is reachable in a DAG. Such a DAG structure is unsupported.

func (ErrInvalidProvenanceStructure) Error

type ErrOutputCommitNotFinished

type ErrOutputCommitNotFinished struct {
	Commit *pfs.Commit
}

ErrOutputCommitNotFinished represents an error where the commit has not been finished

func (ErrOutputCommitNotFinished) Error

type ErrParentCommitNotFound

type ErrParentCommitNotFound struct {
	Commit *pfs.Commit
}

ErrParentCommitNotFound represents a parent-commit-not-found error.

func (ErrParentCommitNotFound) Error

func (e ErrParentCommitNotFound) Error() string

func (ErrParentCommitNotFound) GRPCStatus

func (e ErrParentCommitNotFound) GRPCStatus() *status.Status

type ErrProjectExists

type ErrProjectExists struct {
	Project *pfs.Project
}

ErrProjectExists represents a project-exists error.

func (ErrProjectExists) Error

func (e ErrProjectExists) Error() string

func (ErrProjectExists) GRPCStatus

func (e ErrProjectExists) GRPCStatus() *status.Status

type ErrProjectNotFound

type ErrProjectNotFound struct {
	Project *pfs.Project
}

ErrProjectNotFound represents a project-not-found error.

func (ErrProjectNotFound) Error

func (e ErrProjectNotFound) Error() string

func (ErrProjectNotFound) GRPCStatus

func (e ErrProjectNotFound) GRPCStatus() *status.Status

type ErrRepoExists

type ErrRepoExists struct {
	Repo *pfs.Repo
}

ErrRepoExists represents a repo-exists error.

func (ErrRepoExists) Error

func (e ErrRepoExists) Error() string

func (ErrRepoExists) GRPCStatus

func (e ErrRepoExists) GRPCStatus() *status.Status

type ErrRepoNotFound

type ErrRepoNotFound struct {
	Repo *pfs.Repo
}

ErrRepoNotFound represents a repo-not-found error.

func (ErrRepoNotFound) Error

func (e ErrRepoNotFound) Error() string

func (ErrRepoNotFound) GRPCStatus

func (e ErrRepoNotFound) GRPCStatus() *status.Status

type ErrSquashWithSubvenance

type ErrSquashWithSubvenance struct {
	CommitSet           *pfs.CommitSet
	SubvenantCommitSets []*pfs.CommitSet
}

ErrSquashWithSubvenance represents an error where a commit set cannot be deleted because it contains commits that are depended on by commits in another commit set. The dependent commit sets can be deleted by passing a force flag.

func (ErrSquashWithSubvenance) Error

func (e ErrSquashWithSubvenance) Error() string

type ErrSquashWithoutChildren

type ErrSquashWithoutChildren struct {
	Commit *pfs.Commit
}

ErrSquashWithoutChildren represents an error when attempting to squash a commit that has no children. Since squash works by removing a commit and leaving its data in any child commits, a squash would result in data loss in this situation, so it is not allowed. To proceed anyway, use the DropCommitSet operation, which implies data loss.

func (ErrSquashWithoutChildren) Error

func (e ErrSquashWithoutChildren) Error() string

Directories

Path Synopsis
TODO: the s2 library checks the type of the error to decide how to handle it, which doesn't work properly with wrapped errors
TODO: the s2 library checks the type of the error to decide how to handle it, which doesn't work properly with wrapped errors

Jump to

Keyboard shortcuts

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