Documentation ¶
Index ¶
- Constants
- Variables
- func EntryToValue(entry *Entry) (*graveler.Value, error)
- func MustEntryToValue(entry *Entry) *graveler.Value
- func NewEntryToValueIterator(it EntryIterator) *entryValueIterator
- func NewValueToEntryIterator(it graveler.ValueIterator) *valueEntryIterator
- func Validate(args []ValidateArg) error
- func ValidateBranchID(v interface{}) error
- func ValidateCommitID(v interface{}) error
- func ValidateNonNegativeInt(v interface{}) error
- func ValidatePath(v interface{}) error
- func ValidateRef(v interface{}) error
- func ValidateRepositoryID(v interface{}) error
- func ValidateRequiredString(v interface{}) error
- func ValidateStorageNamespace(v interface{}) error
- func ValidateTagID(v interface{}) error
- type ActionsOutputWriter
- type ActionsSource
- type Branch
- type Catalog
- func (c *Catalog) BranchExists(ctx context.Context, repository string, branch string) (bool, error)
- func (c *Catalog) Close() error
- func (c *Catalog) Commit(ctx context.Context, repository string, branch string, message string, ...) (*CommitLog, error)
- func (c *Catalog) Compare(ctx context.Context, repository, leftReference string, rightReference string, ...) (Differences, bool, error)
- func (c *Catalog) CreateBareRepository(ctx context.Context, repository string, storageNamespace string, ...) (*Repository, error)
- func (c *Catalog) CreateBranch(ctx context.Context, repository string, branch string, sourceBranch string) (*CommitLog, error)
- func (c *Catalog) CreateEntries(ctx context.Context, repository string, branch string, entries []DBEntry) error
- func (c *Catalog) CreateEntry(ctx context.Context, repository string, branch string, entry DBEntry) error
- func (c *Catalog) CreateRepository(ctx context.Context, repository string, storageNamespace string, branch string) (*Repository, error)
- func (c *Catalog) CreateTag(ctx context.Context, repository string, tagID string, ref string) (string, error)
- func (c *Catalog) DeleteBranch(ctx context.Context, repository string, branch string) error
- func (c *Catalog) DeleteEntry(ctx context.Context, repository string, branch string, path string) error
- func (c *Catalog) DeleteRepository(ctx context.Context, repository string) error
- func (c *Catalog) DeleteTag(ctx context.Context, repository string, tagID string) error
- func (c *Catalog) Diff(ctx context.Context, repository string, leftReference string, ...) (Differences, bool, error)
- func (c *Catalog) DiffUncommitted(ctx context.Context, repository string, branch string, limit int, after string) (Differences, bool, error)
- func (c *Catalog) DumpBranches(ctx context.Context, repositoryID string) (string, error)
- func (c *Catalog) DumpCommits(ctx context.Context, repositoryID string) (string, error)
- func (c *Catalog) DumpTags(ctx context.Context, repositoryID string) (string, error)
- func (c *Catalog) GetBranchReference(ctx context.Context, repository string, branch string) (string, error)
- func (c *Catalog) GetCommit(ctx context.Context, repository string, reference string) (*CommitLog, error)
- func (c *Catalog) GetEntry(ctx context.Context, repository string, reference string, path string, ...) (*DBEntry, error)
- func (c *Catalog) GetMetaRange(ctx context.Context, repositoryID, metaRangeID string) (graveler.MetaRangeInfo, error)
- func (c *Catalog) GetRange(ctx context.Context, repositoryID, rangeID string) (graveler.RangeInfo, error)
- func (c *Catalog) GetRepository(ctx context.Context, repository string) (*Repository, error)
- func (c *Catalog) GetTag(ctx context.Context, repository string, tagID string) (string, error)
- func (c *Catalog) ListBranches(ctx context.Context, repository string, prefix string, limit int, after string) ([]*Branch, bool, error)
- func (c *Catalog) ListCommits(ctx context.Context, repository string, branch string, fromReference string, ...) ([]*CommitLog, bool, error)
- func (c *Catalog) ListEntries(ctx context.Context, repository string, reference string, prefix string, ...) ([]*DBEntry, bool, error)
- func (c *Catalog) ListRepositories(ctx context.Context, limit int, after string) ([]*Repository, bool, error)
- func (c *Catalog) ListTags(ctx context.Context, repository string, limit int, after string) ([]*Tag, bool, error)
- func (c *Catalog) LoadBranches(ctx context.Context, repositoryID, branchesMetaRangeID string) error
- func (c *Catalog) LoadCommits(ctx context.Context, repositoryID, commitsMetaRangeID string) error
- func (c *Catalog) LoadTags(ctx context.Context, repositoryID, tagsMetaRangeID string) error
- func (c *Catalog) Merge(ctx context.Context, repository string, destinationBranch string, ...) (*MergeResult, error)
- func (c *Catalog) ResetBranch(ctx context.Context, repository string, branch string) error
- func (c *Catalog) ResetEntries(ctx context.Context, repository string, branch string, prefix string) error
- func (c *Catalog) ResetEntry(ctx context.Context, repository string, branch string, path string) error
- func (c *Catalog) Revert(ctx context.Context, repository string, branch string, params RevertParams) error
- func (c *Catalog) RollbackCommit(_ context.Context, _ string, _ string, _ string) error
- func (c *Catalog) SetHooksHandler(hooks graveler.HooksHandler)
- type CommitLog
- type Config
- type DBEntry
- type DiffParams
- type DiffResultRecord
- type Difference
- type DifferenceType
- type Differences
- type Entry
- func (*Entry) Descriptor() ([]byte, []int)deprecated
- func (x *Entry) GetAddress() string
- func (x *Entry) GetETag() string
- func (x *Entry) GetLastModified() *timestamppb.Timestamp
- func (x *Entry) GetMetadata() map[string]string
- func (x *Entry) GetSize() int64
- func (*Entry) ProtoMessage()
- func (x *Entry) ProtoReflect() protoreflect.Message
- func (x *Entry) Reset()
- func (x *Entry) String() string
- type EntryDiff
- type EntryDiffIterator
- type EntryIterator
- type EntryListing
- type EntryListingIterator
- type EntryRecord
- type ExpireResult
- type ExpiryRows
- type GetEntryParams
- type Interface
- type MergeResult
- type Metadata
- type Path
- type Repository
- type RevertParams
- type Store
- type Tag
- type ValidateArg
- type ValidateFunc
Constants ¶
const ( RangeFSName = "range" MetaRangeFSName = "meta-range" )
const ( ListRepositoriesLimitMax = 1000 ListBranchesLimitMax = 1000 ListTagsLimitMax = 1000 DiffLimitMax = 1000 ListEntriesLimitMax = 10000 )
const ( DBEntryFieldChecksum = "checksum" DBEntryFieldPhysicalAddress = "physical_address" )
const (
DefaultPathDelimiter = "/"
)
const (
MaxPathLength = 1024
)
Variables ¶
var ( ErrNotFound = db.ErrNotFound ErrInvalidMetadataSrcFormat = errors.New("invalid metadata src format") ErrExpired = errors.New("expired from storage") ErrFeatureNotSupported = errors.New("feature not supported") ErrBranchNotFound = fmt.Errorf("branch %w", ErrNotFound) ErrRepositoryNotFound = fmt.Errorf("repository %w", ErrNotFound) ErrInvalidValue = errors.New("invalid value") ErrNoDifferenceWasFound = errors.New("no difference was found") ErrConflictFound = errors.New("conflict found") )
var ( ErrInvalidType = errors.New("invalid type") ErrRequiredValue = errors.New("required value") )
var ErrUnknownDiffType = errors.New("unknown graveler difference type")
var File_catalog_proto protoreflect.FileDescriptor
var ValidatePathOptional = MakeValidateOptional(ValidatePath)
var ValidateTagIDOptional = MakeValidateOptional(ValidateTagID)
Functions ¶
func MustEntryToValue ¶
func NewEntryToValueIterator ¶
func NewEntryToValueIterator(it EntryIterator) *entryValueIterator
func NewValueToEntryIterator ¶
func NewValueToEntryIterator(it graveler.ValueIterator) *valueEntryIterator
func Validate ¶
func Validate(args []ValidateArg) error
func ValidateBranchID ¶
func ValidateBranchID(v interface{}) error
func ValidateCommitID ¶
func ValidateCommitID(v interface{}) error
func ValidateNonNegativeInt ¶
func ValidateNonNegativeInt(v interface{}) error
func ValidatePath ¶
func ValidatePath(v interface{}) error
func ValidateRef ¶
func ValidateRef(v interface{}) error
func ValidateRepositoryID ¶
func ValidateRepositoryID(v interface{}) error
func ValidateRequiredString ¶
func ValidateRequiredString(v interface{}) error
func ValidateStorageNamespace ¶
func ValidateStorageNamespace(v interface{}) error
func ValidateTagID ¶
func ValidateTagID(v interface{}) error
Types ¶
type ActionsOutputWriter ¶
type ActionsOutputWriter struct {
// contains filtered or unexported fields
}
func NewActionsOutputWriter ¶
func NewActionsOutputWriter(blockAdapter block.Adapter) *ActionsOutputWriter
func (*ActionsOutputWriter) OutputWrite ¶
type ActionsSource ¶
type ActionsSource struct {
// contains filtered or unexported fields
}
func NewActionsSource ¶
func NewActionsSource(catalog *Catalog) *ActionsSource
func (*ActionsSource) List ¶
func (s *ActionsSource) List(ctx context.Context, record graveler.HookRecord) ([]string, error)
func (*ActionsSource) Load ¶
func (s *ActionsSource) Load(ctx context.Context, record graveler.HookRecord, name string) ([]byte, error)
type Catalog ¶
type Catalog struct { BlockAdapter block.Adapter Store Store // contains filtered or unexported fields }
func (*Catalog) BranchExists ¶
func (*Catalog) Compare ¶
func (c *Catalog) Compare(ctx context.Context, repository, leftReference string, rightReference string, params DiffParams) (Differences, bool, error)
func (*Catalog) CreateBareRepository ¶
func (c *Catalog) CreateBareRepository(ctx context.Context, repository string, storageNamespace string, defaultBranchID string) (*Repository, error)
CreateBareRepository creates a new repository pointing to 'storageNamespace' (ex: s3://bucket1/repo) with no initial branch or commit
func (*Catalog) CreateBranch ¶
func (*Catalog) CreateEntries ¶
func (*Catalog) CreateEntry ¶
func (*Catalog) CreateRepository ¶
func (c *Catalog) CreateRepository(ctx context.Context, repository string, storageNamespace string, branch string) (*Repository, error)
CreateRepository create a new repository pointing to 'storageNamespace' (ex: s3://bucket1/repo) with default branch name 'branch'
func (*Catalog) DeleteBranch ¶
func (*Catalog) DeleteEntry ¶
func (*Catalog) DeleteRepository ¶
DeleteRepository delete a repository
func (*Catalog) Diff ¶
func (c *Catalog) Diff(ctx context.Context, repository string, leftReference string, rightReference string, params DiffParams) (Differences, bool, error)
func (*Catalog) DiffUncommitted ¶
func (*Catalog) DumpBranches ¶
func (*Catalog) DumpCommits ¶
func (*Catalog) GetBranchReference ¶
func (*Catalog) GetEntry ¶
func (c *Catalog) GetEntry(ctx context.Context, repository string, reference string, path string, _ GetEntryParams) (*DBEntry, error)
GetEntry returns the current entry for path in repository branch reference. Returns the entry with ExpiredError if it has expired from underlying storage.
func (*Catalog) GetMetaRange ¶
func (*Catalog) GetRepository ¶
GetRepository get repository information
func (*Catalog) ListBranches ¶
func (*Catalog) ListCommits ¶
func (*Catalog) ListEntries ¶
func (*Catalog) ListRepositories ¶
func (c *Catalog) ListRepositories(ctx context.Context, limit int, after string) ([]*Repository, bool, error)
ListRepositories list repositories information, the bool returned is true when more repositories can be listed. In this case pass the last repository name as 'after' on the next call to ListRepositories
func (*Catalog) LoadBranches ¶
func (*Catalog) LoadCommits ¶
func (*Catalog) ResetBranch ¶
func (*Catalog) ResetEntries ¶
func (*Catalog) ResetEntry ¶
func (*Catalog) RollbackCommit ¶
func (*Catalog) SetHooksHandler ¶
func (c *Catalog) SetHooksHandler(hooks graveler.HooksHandler)
type DiffParams ¶
type DiffResultRecord ¶
type DiffResultRecord struct { TargetEntryNotInDirectBranch bool // the entry is reflected via lineage, NOT in the branch itself Difference EntryCtid *string // CTID of the modified/added entry. Do not use outside of catalog diff-by-iterators. https://github.com/treeverse/lakeFS/issues/831 }
type Difference ¶
type Difference struct { DBEntry // Partially filled. Path is always set. Type DifferenceType `db:"diff_type"` }
func (Difference) String ¶
func (d Difference) String() string
type DifferenceType ¶
type DifferenceType int
const ( DifferenceTypeAdded DifferenceType = iota DifferenceTypeRemoved DifferenceTypeChanged DifferenceTypeConflict DifferenceTypeNone )
type Differences ¶
type Differences []Difference
func (Differences) Equal ¶
func (d Differences) Equal(other Differences) bool
type Entry ¶
type Entry struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` LastModified *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_modified,json=lastModified,proto3" json:"last_modified,omitempty"` Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` ETag string `protobuf:"bytes,4,opt,name=e_tag,json=eTag,proto3" json:"e_tag,omitempty"` Metadata map[string]string `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
func EntryFromCatalogEntry ¶
func (*Entry) Descriptor
deprecated
func (*Entry) GetAddress ¶
func (*Entry) GetLastModified ¶
func (x *Entry) GetLastModified() *timestamppb.Timestamp
func (*Entry) GetMetadata ¶
func (*Entry) ProtoMessage ¶
func (*Entry) ProtoMessage()
func (*Entry) ProtoReflect ¶
func (x *Entry) ProtoReflect() protoreflect.Message
type EntryDiffIterator ¶
type EntryDiffIterator interface { Next() bool SeekGE(id Path) Value() *EntryDiff Err() error Close() }
func NewEntryDiffIterator ¶
func NewEntryDiffIterator(it graveler.DiffIterator) EntryDiffIterator
type EntryIterator ¶
type EntryIterator interface { Next() bool SeekGE(id Path) Value() *EntryRecord Err() error Close() }
func NewPrefixIterator ¶
func NewPrefixIterator(it EntryIterator, prefix Path) EntryIterator
type EntryListing ¶
type EntryListingIterator ¶
type EntryListingIterator interface { Next() bool SeekGE(id Path) Value() *EntryListing Err() error Close() }
func NewEntryListingIterator ¶
func NewEntryListingIterator(it EntryIterator, prefix Path, delimiter Path) EntryListingIterator
type EntryRecord ¶
type ExpireResult ¶
type ExpiryRows ¶
type ExpiryRows interface { Close() Next() bool Err() error // Read returns the current from ExpiryRows, or an error on failure. Call it only after // successfully calling Next. Read() (*ExpireResult, error) }
ExpiryRows is a database iterator over ExpiryResults. Use Next to advance from row to row.
type GetEntryParams ¶
type GetEntryParams struct { // For entries to expired objects the Expired bit is set. If true, GetEntry returns // successfully for expired entries, otherwise it returns the entry with ErrExpired. ReturnExpired bool }
GetEntryParams configures what entries GetEntry returns.
type Interface ¶
type Interface interface { // CreateRepository create a new repository pointing to 'storageNamespace' (ex: s3://bucket1/repo) with default branch name 'branch' CreateRepository(ctx context.Context, repository string, storageNamespace string, branch string) (*Repository, error) // CreateBareRepository create a new repository pointing to 'storageNamespace' (ex: s3://bucket1/repo) with no initial branch or commit // defaultBranchID will point to a non-existent branch on creation, it is up to the caller to eventually create it. CreateBareRepository(ctx context.Context, repository string, storageNamespace string, defaultBranchID string) (*Repository, error) // GetRepository get repository information GetRepository(ctx context.Context, repository string) (*Repository, error) // DeleteRepository delete a repository DeleteRepository(ctx context.Context, repository string) error // ListRepositories list repositories information, the bool returned is true when more repositories can be listed. // In this case pass the last repository name as 'after' on the next call to ListRepositories ListRepositories(ctx context.Context, limit int, after string) ([]*Repository, bool, error) CreateBranch(ctx context.Context, repository, branch string, sourceRef string) (*CommitLog, error) DeleteBranch(ctx context.Context, repository, branch string) error ListBranches(ctx context.Context, repository string, prefix string, limit int, after string) ([]*Branch, bool, error) BranchExists(ctx context.Context, repository string, branch string) (bool, error) GetBranchReference(ctx context.Context, repository, branch string) (string, error) ResetBranch(ctx context.Context, repository, branch string) error CreateTag(ctx context.Context, repository, tagID string, ref string) (string, error) DeleteTag(ctx context.Context, repository, tagID string) error ListTags(ctx context.Context, repository string, limit int, after string) ([]*Tag, bool, error) GetTag(ctx context.Context, repository, tagID string) (string, error) // GetEntry returns the current entry for path in repository branch reference. Returns // the entry with ExpiredError if it has expired from underlying storage. GetEntry(ctx context.Context, repository, reference string, path string, params GetEntryParams) (*DBEntry, error) CreateEntry(ctx context.Context, repository, branch string, entry DBEntry) error CreateEntries(ctx context.Context, repository, branch string, entries []DBEntry) error DeleteEntry(ctx context.Context, repository, branch string, path string) error ListEntries(ctx context.Context, repository, reference string, prefix, after string, delimiter string, limit int) ([]*DBEntry, bool, error) ResetEntry(ctx context.Context, repository, branch string, path string) error ResetEntries(ctx context.Context, repository, branch string, prefix string) error Commit(ctx context.Context, repository, branch string, message string, committer string, metadata Metadata) (*CommitLog, error) GetCommit(ctx context.Context, repository, reference string) (*CommitLog, error) ListCommits(ctx context.Context, repository, branch string, fromReference string, limit int) ([]*CommitLog, bool, error) // RollbackCommit sets the branch to point at the given commit, losing all later commits. RollbackCommit(ctx context.Context, repository, branch string, reference string) error // Revert creates a reverse patch to the given commit, and applies it as a new commit on the given branch. Revert(ctx context.Context, repository, branch string, params RevertParams) error Diff(ctx context.Context, repository, leftReference string, rightReference string, params DiffParams) (Differences, bool, error) Compare(ctx context.Context, repository, leftReference string, rightReference string, params DiffParams) (Differences, bool, error) DiffUncommitted(ctx context.Context, repository, branch string, limit int, after string) (Differences, bool, error) Merge(ctx context.Context, repository, destinationBranch, sourceRef, committer, message string, metadata Metadata) (*MergeResult, error) // dump/load metadata DumpCommits(ctx context.Context, repositoryID string) (string, error) DumpBranches(ctx context.Context, repositoryID string) (string, error) DumpTags(ctx context.Context, repositoryID string) (string, error) LoadCommits(ctx context.Context, repositoryID, commitsMetaRangeID string) error LoadBranches(ctx context.Context, repositoryID, branchesMetaRangeID string) error LoadTags(ctx context.Context, repositoryID, tagsMetaRangeID string) error // forward metadata for thick clients GetMetaRange(ctx context.Context, repositoryID, metaRangeID string) (graveler.MetaRangeInfo, error) GetRange(ctx context.Context, repositoryID, rangeID string) (graveler.RangeInfo, error) io.Closer }
type MergeResult ¶
type MergeResult struct { Summary map[DifferenceType]int Reference string }
type Repository ¶
type RevertParams ¶
type Store ¶
type Store interface { graveler.KeyValueStore graveler.VersionController graveler.Dumper graveler.Loader graveler.Plumbing }
type ValidateArg ¶
type ValidateArg struct { Name string Value interface{} Fn ValidateFunc }
type ValidateFunc ¶
type ValidateFunc func(v interface{}) error
func MakeValidateOptional ¶
func MakeValidateOptional(fn ValidateFunc) ValidateFunc