Documentation
¶
Index ¶
- Constants
- Variables
- func NewRunID() string
- func UpperBoundForPrefix(prefix []byte) []byte
- func ValidateBranchID(v interface{}) error
- func ValidateCommitID(v interface{}) error
- func ValidateRef(v interface{}) error
- func ValidateRepositoryID(v interface{}) error
- func ValidateRequiredStrategy(v interface{}) error
- func ValidateStorageNamespace(v interface{}) error
- func ValidateTagID(v interface{}) error
- type Branch
- type BranchData
- type BranchID
- type BranchIterator
- type BranchLocker
- type BranchLockerFunc
- type BranchProtectionBlockedAction
- func (BranchProtectionBlockedAction) Descriptor() protoreflect.EnumDescriptor
- func (x BranchProtectionBlockedAction) Enum() *BranchProtectionBlockedAction
- func (BranchProtectionBlockedAction) EnumDescriptor() ([]byte, []int)deprecated
- func (x BranchProtectionBlockedAction) Number() protoreflect.EnumNumber
- func (x BranchProtectionBlockedAction) String() string
- func (BranchProtectionBlockedAction) Type() protoreflect.EnumType
- type BranchProtectionBlockedActions
- func (*BranchProtectionBlockedActions) Descriptor() ([]byte, []int)deprecated
- func (x *BranchProtectionBlockedActions) GetValue() []BranchProtectionBlockedAction
- func (*BranchProtectionBlockedActions) ProtoMessage()
- func (x *BranchProtectionBlockedActions) ProtoReflect() protoreflect.Message
- func (x *BranchProtectionBlockedActions) Reset()
- func (x *BranchProtectionBlockedActions) String() string
- type BranchProtectionRules
- func (*BranchProtectionRules) Descriptor() ([]byte, []int)deprecated
- func (x *BranchProtectionRules) GetBranchPatternToBlockedActions() map[string]*BranchProtectionBlockedActions
- func (*BranchProtectionRules) ProtoMessage()
- func (x *BranchProtectionRules) ProtoReflect() protoreflect.Message
- func (x *BranchProtectionRules) Reset()
- func (x *BranchProtectionRules) String() string
- type BranchRecord
- type CombinedDiffIterator
- type CombinedIterator
- type Commit
- type CommitData
- func (*CommitData) Descriptor() ([]byte, []int)deprecated
- func (x *CommitData) GetCommitter() string
- func (x *CommitData) GetCreationDate() *timestamppb.Timestamp
- func (x *CommitData) GetGeneration() int32
- func (x *CommitData) GetId() string
- func (x *CommitData) GetMessage() string
- func (x *CommitData) GetMetaRangeId() string
- func (x *CommitData) GetMetadata() map[string]string
- func (x *CommitData) GetParents() []string
- func (x *CommitData) GetVersion() int32
- func (*CommitData) ProtoMessage()
- func (x *CommitData) ProtoReflect() protoreflect.Message
- func (x *CommitData) Reset()
- func (x *CommitData) String() string
- type CommitID
- type CommitIDAndSummary
- type CommitIterator
- type CommitParams
- type CommitParents
- type CommitRecord
- type CommitVersion
- type CommittedManager
- type DBGraveler
- func (g *DBGraveler) AddCommit(ctx context.Context, repositoryID RepositoryID, commit Commit) (CommitID, error)
- func (g *DBGraveler) AddCommitToBranchHead(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ...) (CommitID, error)
- func (g *DBGraveler) Commit(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ...) (CommitID, error)
- func (g *DBGraveler) Compare(ctx context.Context, repositoryID RepositoryID, left, right Ref) (DiffIterator, error)
- func (g *DBGraveler) CreateBareRepository(ctx context.Context, repositoryID RepositoryID, ...) (*Repository, error)
- func (g *DBGraveler) CreateBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref) (*Branch, error)
- func (g *DBGraveler) CreateBranchProtectionRule(ctx context.Context, repositoryID RepositoryID, pattern string, ...) error
- func (g *DBGraveler) CreateRepository(ctx context.Context, repositoryID RepositoryID, ...) (*Repository, error)
- func (g *DBGraveler) CreateTag(ctx context.Context, repositoryID RepositoryID, tagID TagID, commitID CommitID) error
- func (g *DBGraveler) Delete(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
- func (g *DBGraveler) DeleteBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) error
- func (g *DBGraveler) DeleteBranchProtectionRule(ctx context.Context, repositoryID RepositoryID, pattern string) error
- func (g *DBGraveler) DeleteRepository(ctx context.Context, repositoryID RepositoryID) error
- func (g *DBGraveler) DeleteTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) error
- func (g *DBGraveler) Dereference(ctx context.Context, repositoryID RepositoryID, ref Ref) (*ResolvedRef, error)
- func (g *DBGraveler) Diff(ctx context.Context, repositoryID RepositoryID, left, right Ref) (DiffIterator, error)
- func (g *DBGraveler) DiffUncommitted(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (DiffIterator, error)
- func (g *DBGraveler) DumpBranches(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
- func (g *DBGraveler) DumpCommits(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
- func (g *DBGraveler) DumpTags(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
- func (g *DBGraveler) Get(ctx context.Context, repositoryID RepositoryID, ref Ref, key Key) (*Value, error)
- func (g *DBGraveler) GetBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (*Branch, error)
- func (g *DBGraveler) GetBranchProtectionRules(ctx context.Context, repositoryID RepositoryID) (*BranchProtectionRules, error)
- func (g *DBGraveler) GetCommit(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (*Commit, error)
- func (g *DBGraveler) GetGarbageCollectionRules(ctx context.Context, repositoryID RepositoryID) (*GarbageCollectionRules, error)
- func (g *DBGraveler) GetMetaRange(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) (MetaRangeAddress, error)
- func (g *DBGraveler) GetRange(ctx context.Context, repositoryID RepositoryID, rangeID RangeID) (RangeAddress, error)
- func (g *DBGraveler) GetRepository(ctx context.Context, repositoryID RepositoryID) (*Repository, error)
- func (g *DBGraveler) GetStagingToken(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (*StagingToken, error)
- func (g *DBGraveler) GetTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) (*CommitID, error)
- func (g *DBGraveler) List(ctx context.Context, repositoryID RepositoryID, ref Ref) (ValueIterator, error)
- func (g *DBGraveler) ListBranches(ctx context.Context, repositoryID RepositoryID) (BranchIterator, error)
- func (g *DBGraveler) ListRepositories(ctx context.Context) (RepositoryIterator, error)
- func (g *DBGraveler) ListTags(ctx context.Context, repositoryID RepositoryID) (TagIterator, error)
- func (g *DBGraveler) LoadBranches(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
- func (g *DBGraveler) LoadCommits(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
- func (g *DBGraveler) LoadTags(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
- func (g *DBGraveler) Log(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (CommitIterator, error)
- func (g *DBGraveler) Merge(ctx context.Context, repositoryID RepositoryID, destination BranchID, ...) (CommitID, error)
- func (g *DBGraveler) ParseRef(ref Ref) (RawRef, error)
- func (g *DBGraveler) Reset(ctx context.Context, repositoryID RepositoryID, branchID BranchID) error
- func (g *DBGraveler) ResetKey(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
- func (g *DBGraveler) ResetPrefix(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
- func (g *DBGraveler) ResolveRawRef(ctx context.Context, repositoryID RepositoryID, rawRef RawRef) (*ResolvedRef, error)
- func (g *DBGraveler) Revert(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref, ...) (CommitID, error)
- func (g *DBGraveler) SaveGarbageCollectionCommits(ctx context.Context, repositoryID RepositoryID, previousRunID string) (*GarbageCollectionRunMetadata, error)
- func (g *DBGraveler) Set(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key, ...) error
- func (g *DBGraveler) SetGarbageCollectionRules(ctx context.Context, repositoryID RepositoryID, rules *GarbageCollectionRules) error
- func (g *DBGraveler) SetHooksHandler(handler HooksHandler)
- func (g *DBGraveler) UpdateBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref) (*Branch, error)
- func (g *DBGraveler) WriteMetaRange(ctx context.Context, repositoryID RepositoryID, ranges []*RangeInfo) (*MetaRangeInfo, error)
- func (g *DBGraveler) WriteMetaRangeByIterator(ctx context.Context, repositoryID RepositoryID, it ValueIterator) (*MetaRangeID, error)
- func (g *DBGraveler) WriteRange(ctx context.Context, repositoryID RepositoryID, it ValueIterator) (*RangeInfo, error)
- type Diff
- type DiffIterator
- type DiffSummary
- type DiffType
- type Dumper
- type EventType
- type GarbageCollectionManager
- type GarbageCollectionRules
- func (*GarbageCollectionRules) Descriptor() ([]byte, []int)deprecated
- func (x *GarbageCollectionRules) GetBranchRetentionDays() map[string]int32
- func (x *GarbageCollectionRules) GetDefaultRetentionDays() int32
- func (*GarbageCollectionRules) ProtoMessage()
- func (x *GarbageCollectionRules) ProtoReflect() protoreflect.Message
- func (x *GarbageCollectionRules) Reset()
- func (x *GarbageCollectionRules) String() string
- type GarbageCollectionRunMetadata
- func (*GarbageCollectionRunMetadata) Descriptor() ([]byte, []int)deprecated
- func (x *GarbageCollectionRunMetadata) GetAddressLocation() string
- func (x *GarbageCollectionRunMetadata) GetCommitsCsvLocation() string
- func (x *GarbageCollectionRunMetadata) GetRunId() string
- func (*GarbageCollectionRunMetadata) ProtoMessage()
- func (x *GarbageCollectionRunMetadata) ProtoReflect() protoreflect.Message
- func (x *GarbageCollectionRunMetadata) Reset()
- func (x *GarbageCollectionRunMetadata) String() string
- type HookAbortError
- type HookRecord
- type HooksHandler
- type HooksNoOp
- func (h *HooksNoOp) NewRunID() string
- func (h *HooksNoOp) PostCommitHook(context.Context, HookRecord) error
- func (h *HooksNoOp) PostCreateBranchHook(context.Context, HookRecord)
- func (h *HooksNoOp) PostCreateTagHook(context.Context, HookRecord)
- func (h *HooksNoOp) PostDeleteBranchHook(context.Context, HookRecord)
- func (h *HooksNoOp) PostDeleteTagHook(context.Context, HookRecord)
- func (h *HooksNoOp) PostMergeHook(context.Context, HookRecord) error
- func (h *HooksNoOp) PreCommitHook(context.Context, HookRecord) error
- func (h *HooksNoOp) PreCreateBranchHook(context.Context, HookRecord) error
- func (h *HooksNoOp) PreCreateTagHook(context.Context, HookRecord) error
- func (h *HooksNoOp) PreDeleteBranchHook(context.Context, HookRecord) error
- func (h *HooksNoOp) PreDeleteTagHook(context.Context, HookRecord) error
- func (h *HooksNoOp) PreMergeHook(context.Context, HookRecord) error
- type KVGraveler
- func (g *KVGraveler) AddCommit(ctx context.Context, repositoryID RepositoryID, commit Commit) (CommitID, error)
- func (g *KVGraveler) AddCommitToBranchHead(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ...) (CommitID, error)
- func (g *KVGraveler) Commit(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ...) (CommitID, error)
- func (g *KVGraveler) Compare(ctx context.Context, repositoryID RepositoryID, left, right Ref) (DiffIterator, error)
- func (g *KVGraveler) CreateBareRepository(ctx context.Context, repositoryID RepositoryID, ...) (*Repository, error)
- func (g *KVGraveler) CreateBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref) (*Branch, error)
- func (g *KVGraveler) CreateBranchProtectionRule(ctx context.Context, repositoryID RepositoryID, pattern string, ...) error
- func (g *KVGraveler) CreateRepository(ctx context.Context, repositoryID RepositoryID, ...) (*Repository, error)
- func (g *KVGraveler) CreateTag(ctx context.Context, repositoryID RepositoryID, tagID TagID, commitID CommitID) error
- func (g *KVGraveler) Delete(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
- func (g *KVGraveler) DeleteBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) error
- func (g *KVGraveler) DeleteBranchProtectionRule(ctx context.Context, repositoryID RepositoryID, pattern string) error
- func (g *KVGraveler) DeleteRepository(ctx context.Context, repositoryID RepositoryID) error
- func (g *KVGraveler) DeleteTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) error
- func (g *KVGraveler) Dereference(ctx context.Context, repositoryID RepositoryID, ref Ref) (*ResolvedRef, error)
- func (g *KVGraveler) Diff(ctx context.Context, repositoryID RepositoryID, left, right Ref) (DiffIterator, error)
- func (g *KVGraveler) DiffUncommitted(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (DiffIterator, error)
- func (g *KVGraveler) DumpBranches(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
- func (g *KVGraveler) DumpCommits(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
- func (g *KVGraveler) DumpTags(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
- func (g *KVGraveler) Get(ctx context.Context, repositoryID RepositoryID, ref Ref, key Key) (*Value, error)
- func (g *KVGraveler) GetBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (*Branch, error)
- func (g *KVGraveler) GetBranchProtectionRules(ctx context.Context, repositoryID RepositoryID) (*BranchProtectionRules, error)
- func (g *KVGraveler) GetCommit(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (*Commit, error)
- func (g *KVGraveler) GetGarbageCollectionRules(ctx context.Context, repositoryID RepositoryID) (*GarbageCollectionRules, error)
- func (g *KVGraveler) GetMetaRange(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) (MetaRangeAddress, error)
- func (g *KVGraveler) GetRange(ctx context.Context, repositoryID RepositoryID, rangeID RangeID) (RangeAddress, error)
- func (g *KVGraveler) GetRepository(ctx context.Context, repositoryID RepositoryID) (*Repository, error)
- func (g *KVGraveler) GetStagingToken(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (*StagingToken, error)
- func (g *KVGraveler) GetTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) (*CommitID, error)
- func (g *KVGraveler) List(ctx context.Context, repositoryID RepositoryID, ref Ref) (ValueIterator, error)
- func (g *KVGraveler) ListBranches(ctx context.Context, repositoryID RepositoryID) (BranchIterator, error)
- func (g *KVGraveler) ListRepositories(ctx context.Context) (RepositoryIterator, error)
- func (g *KVGraveler) ListTags(ctx context.Context, repositoryID RepositoryID) (TagIterator, error)
- func (g *KVGraveler) LoadBranches(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
- func (g *KVGraveler) LoadCommits(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
- func (g *KVGraveler) LoadTags(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
- func (g *KVGraveler) Log(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (CommitIterator, error)
- func (g *KVGraveler) Merge(ctx context.Context, repositoryID RepositoryID, destination BranchID, ...) (CommitID, error)
- func (g *KVGraveler) ParseRef(ref Ref) (RawRef, error)
- func (g *KVGraveler) Reset(ctx context.Context, repositoryID RepositoryID, branchID BranchID) error
- func (g *KVGraveler) ResetKey(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
- func (g *KVGraveler) ResetPrefix(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
- func (g *KVGraveler) ResolveRawRef(ctx context.Context, repositoryID RepositoryID, rawRef RawRef) (*ResolvedRef, error)
- func (g *KVGraveler) Revert(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref, ...) (CommitID, error)
- func (g *KVGraveler) SaveGarbageCollectionCommits(ctx context.Context, repositoryID RepositoryID, previousRunID string) (*GarbageCollectionRunMetadata, error)
- func (g *KVGraveler) Set(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key, ...) error
- func (g *KVGraveler) SetGarbageCollectionRules(ctx context.Context, repositoryID RepositoryID, rules *GarbageCollectionRules) error
- func (g *KVGraveler) SetHooksHandler(handler HooksHandler)
- func (g *KVGraveler) UpdateBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref) (*Branch, error)
- func (g *KVGraveler) WriteMetaRange(ctx context.Context, repositoryID RepositoryID, ranges []*RangeInfo) (*MetaRangeInfo, error)
- func (g *KVGraveler) WriteMetaRangeByIterator(ctx context.Context, repositoryID RepositoryID, it ValueIterator) (*MetaRangeID, error)
- func (g *KVGraveler) WriteRange(ctx context.Context, repositoryID RepositoryID, it ValueIterator) (*RangeInfo, error)
- type Key
- type KeyValueStore
- type Loader
- type MergeStrategy
- type MetaRangeAddress
- type MetaRangeID
- type MetaRangeInfo
- type Metadata
- type Plumbing
- type ProtectedBranchesManager
- type RangeAddress
- type RangeID
- type RangeInfo
- type RawRef
- type Ref
- type RefManager
- type RefModType
- type RefModifier
- type ReferenceType
- type Repository
- type RepositoryID
- type RepositoryIterator
- type RepositoryRecord
- type ResolvedBranchModifier
- type ResolvedRef
- type StagedEntry
- func (*StagedEntry) Descriptor() ([]byte, []int)deprecated
- func (x *StagedEntry) GetData() []byte
- func (x *StagedEntry) GetIdentity() []byte
- func (x *StagedEntry) GetKey() []byte
- func (*StagedEntry) ProtoMessage()
- func (x *StagedEntry) ProtoReflect() protoreflect.Message
- func (x *StagedEntry) Reset()
- func (x *StagedEntry) String() string
- type StagingManager
- type StagingToken
- type StorageNamespace
- type TagData
- type TagID
- type TagIterator
- type TagRecord
- type Value
- type ValueIterator
- type ValueRecord
- type VersionController
- type WriteCondition
- type WriteConditionOption
Constants ¶
const ( ListingDefaultBatchSize = 1000 ListingMaxBatchSize = 100000 MergeStrategySrcWins = "source-wins" MergeStrategyDestWins = "dest-wins" )
const ( EntityTypeKey = "entity" EntityTypeCommit = "commit" EntityTypeBranch = "branch" EntityTypeTag = "tag" EntitySchemaKey = "schema_name" EntitySchemaCommit = "io.treeverse.lakefs.graveler.CommitData" EntitySchemaBranch = "io.treeverse.lakefs.graveler.BranchData" EntitySchemaTag = "io.treeverse.lakefs.graveler.TagData" EntitySchemaDefinitionKey = "schema_definition" )
const FirstCommitMsg = "Repository created"
FirstCommitMsg is the message of the first (zero) commit of a lakeFS repository
Variables ¶
var ( // Base error for "user-visible" errors, which should not be wrapped with internal // debug info. ErrUserVisible = errors.New("") // TODO(ariels): Wrap with ErrUserVisible once db is gone. ErrNotFound = wrapError(db.ErrNotFound, "not found") ErrNotUnique = wrapError(ErrUserVisible, "not unique") ErrPreconditionFailed = errors.New("precondition failed") ErrWriteToProtectedBranch = wrapError(ErrUserVisible, "cannot write to protected branch") ErrCommitToProtectedBranch = wrapError(ErrUserVisible, "cannot commit to protected branch") ErrInvalidValue = fmt.Errorf("invalid value: %w", ErrInvalid) ErrInvalidMergeBase = fmt.Errorf("only 2 commits allowed in FindMergeBase: %w", ErrInvalidValue) ErrNoMergeBase = errors.New("no merge base") ErrInvalidRef = fmt.Errorf("ref: %w", ErrInvalidValue) ErrInvalidCommitID = fmt.Errorf("commit id: %w", ErrInvalidValue) ErrInvalidBranchID = fmt.Errorf("branch id: %w", ErrInvalidValue) ErrInvalidTagID = fmt.Errorf("tag id: %w", ErrInvalidValue) ErrInvalid = errors.New("validation error") ErrInvalidType = fmt.Errorf("invalid type: %w", ErrInvalid) ErrInvalidRepositoryID = fmt.Errorf("repository id: %w", ErrInvalidValue) ErrRequiredValue = fmt.Errorf("required value: %w", ErrInvalid) ErrCommitNotFound = fmt.Errorf("commit %w", ErrNotFound) ErrCreateBranchNoCommit = fmt.Errorf("can't create a branch without commit") ErrRepositoryNotFound = fmt.Errorf("repository %w", ErrNotFound) ErrBranchNotFound = fmt.Errorf("branch %w", ErrNotFound) ErrTagNotFound = fmt.Errorf("tag %w", ErrNotFound) ErrRefAmbiguous = fmt.Errorf("reference is ambiguous: %w", ErrNotFound) ErrNoChanges = wrapError(ErrUserVisible, "no changes") ErrConflictFound = wrapError(ErrUserVisible, "conflict found") ErrCommitNotHeadBranch = wrapError(ErrUserVisible, "commit is not head of branch") ErrBranchExists = fmt.Errorf("branch already exists: %w", ErrNotUnique) ErrTagAlreadyExists = fmt.Errorf("tag already exists: %w", ErrNotUnique) ErrDirtyBranch = wrapError(ErrUserVisible, "uncommitted changes (dirty branch)") ErrMetaRangeNotFound = errors.New("metarange not found") ErrLockNotAcquired = errors.New("lock not acquired") ErrRevertMergeNoParent = wrapError(ErrUserVisible, "must specify 1-based parent number for reverting merge commit") ErrAddCommitNoParent = errors.New("added commit must have a parent") ErrMultipleParents = errors.New("cannot have more than a single parent") ErrRevertParentOutOfRange = errors.New("given commit does not have the given parent number") ErrDereferenceCommitWithStaging = wrapError(ErrUserVisible, "reference to staging area with $ is not a commit") ErrDeleteDefaultBranch = wrapError(ErrUserVisible, "cannot delete repository default branch") ErrCommitMetaRangeDirtyBranch = wrapError(ErrUserVisible, "cannot use source MetaRange on a branch with uncommitted changes") )
var ( BranchProtectionBlockedAction_name = map[int32]string{ 0: "STAGING_WRITE", 1: "COMMIT", } BranchProtectionBlockedAction_value = map[string]int32{ "STAGING_WRITE": 0, "COMMIT": 1, } )
Enum value maps for BranchProtectionBlockedAction.
var File_graveler_proto protoreflect.FileDescriptor
var ValidateTagIDOptional = validator.MakeValidateOptional(ValidateTagID)
Functions ¶
func UpperBoundForPrefix ¶
UpperBoundForPrefix returns, given a prefix `p`, a slice 'q' such that a byte slice `s` starts with `p` if and only if p <= s < q. Namely, it returns an exclusive upper bound for the set of all byte arrays that start with this prefix. It returns nil if there is no such byte slice because all bytes of `p` are maximal.
func ValidateBranchID ¶ added in v0.58.1
func ValidateBranchID(v interface{}) error
func ValidateCommitID ¶ added in v0.58.1
func ValidateCommitID(v interface{}) error
func ValidateRef ¶ added in v0.58.1
func ValidateRef(v interface{}) error
func ValidateRepositoryID ¶ added in v0.58.1
func ValidateRepositoryID(v interface{}) error
func ValidateRequiredStrategy ¶ added in v0.61.0
func ValidateRequiredStrategy(v interface{}) error
func ValidateStorageNamespace ¶ added in v0.58.1
func ValidateStorageNamespace(v interface{}) error
func ValidateTagID ¶ added in v0.58.1
func ValidateTagID(v interface{}) error
Types ¶
type Branch ¶
type Branch struct { CommitID CommitID StagingToken StagingToken }
Branch is a pointer to a commit
type BranchData ¶
type BranchData struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CommitId string `protobuf:"bytes,2,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` // contains filtered or unexported fields }
func (*BranchData) Descriptor
deprecated
func (*BranchData) Descriptor() ([]byte, []int)
Deprecated: Use BranchData.ProtoReflect.Descriptor instead.
func (*BranchData) GetCommitId ¶
func (x *BranchData) GetCommitId() string
func (*BranchData) GetId ¶
func (x *BranchData) GetId() string
func (*BranchData) ProtoMessage ¶
func (*BranchData) ProtoMessage()
func (*BranchData) ProtoReflect ¶
func (x *BranchData) ProtoReflect() protoreflect.Message
func (*BranchData) Reset ¶
func (x *BranchData) Reset()
func (*BranchData) String ¶
func (x *BranchData) String() string
type BranchIterator ¶
type BranchIterator interface { Next() bool SeekGE(id BranchID) Value() *BranchRecord Err() error Close() }
type BranchLocker ¶
type BranchLocker interface { Writer(ctx context.Context, repositoryID RepositoryID, branchID BranchID, lockedFn BranchLockerFunc) (interface{}, error) MetadataUpdater(ctx context.Context, repositoryID RepositoryID, branchID BranchID, lockeFn BranchLockerFunc) (interface{}, error) }
type BranchLockerFunc ¶
type BranchLockerFunc func() (interface{}, error)
BranchLockerFunc callback function when branch is locked for operation (ex: writer or metadata updater)
type BranchProtectionBlockedAction ¶ added in v0.52.0
type BranchProtectionBlockedAction int32
const ( BranchProtectionBlockedAction_STAGING_WRITE BranchProtectionBlockedAction = 0 BranchProtectionBlockedAction_COMMIT BranchProtectionBlockedAction = 1 )
func (BranchProtectionBlockedAction) Descriptor ¶ added in v0.52.0
func (BranchProtectionBlockedAction) Descriptor() protoreflect.EnumDescriptor
func (BranchProtectionBlockedAction) Enum ¶ added in v0.52.0
func (x BranchProtectionBlockedAction) Enum() *BranchProtectionBlockedAction
func (BranchProtectionBlockedAction) EnumDescriptor
deprecated
added in
v0.52.0
func (BranchProtectionBlockedAction) EnumDescriptor() ([]byte, []int)
Deprecated: Use BranchProtectionBlockedAction.Descriptor instead.
func (BranchProtectionBlockedAction) Number ¶ added in v0.52.0
func (x BranchProtectionBlockedAction) Number() protoreflect.EnumNumber
func (BranchProtectionBlockedAction) String ¶ added in v0.52.0
func (x BranchProtectionBlockedAction) String() string
func (BranchProtectionBlockedAction) Type ¶ added in v0.52.0
func (BranchProtectionBlockedAction) Type() protoreflect.EnumType
type BranchProtectionBlockedActions ¶ added in v0.52.0
type BranchProtectionBlockedActions struct { Value []BranchProtectionBlockedAction `` /* 135-byte string literal not displayed */ // contains filtered or unexported fields }
func (*BranchProtectionBlockedActions) Descriptor
deprecated
added in
v0.52.0
func (*BranchProtectionBlockedActions) Descriptor() ([]byte, []int)
Deprecated: Use BranchProtectionBlockedActions.ProtoReflect.Descriptor instead.
func (*BranchProtectionBlockedActions) GetValue ¶ added in v0.52.0
func (x *BranchProtectionBlockedActions) GetValue() []BranchProtectionBlockedAction
func (*BranchProtectionBlockedActions) ProtoMessage ¶ added in v0.52.0
func (*BranchProtectionBlockedActions) ProtoMessage()
func (*BranchProtectionBlockedActions) ProtoReflect ¶ added in v0.52.0
func (x *BranchProtectionBlockedActions) ProtoReflect() protoreflect.Message
func (*BranchProtectionBlockedActions) Reset ¶ added in v0.52.0
func (x *BranchProtectionBlockedActions) Reset()
func (*BranchProtectionBlockedActions) String ¶ added in v0.52.0
func (x *BranchProtectionBlockedActions) String() string
type BranchProtectionRules ¶ added in v0.52.0
type BranchProtectionRules struct { BranchPatternToBlockedActions map[string]*BranchProtectionBlockedActions `` /* 242-byte string literal not displayed */ // contains filtered or unexported fields }
func (*BranchProtectionRules) Descriptor
deprecated
added in
v0.52.0
func (*BranchProtectionRules) Descriptor() ([]byte, []int)
Deprecated: Use BranchProtectionRules.ProtoReflect.Descriptor instead.
func (*BranchProtectionRules) GetBranchPatternToBlockedActions ¶ added in v0.52.0
func (x *BranchProtectionRules) GetBranchPatternToBlockedActions() map[string]*BranchProtectionBlockedActions
func (*BranchProtectionRules) ProtoMessage ¶ added in v0.52.0
func (*BranchProtectionRules) ProtoMessage()
func (*BranchProtectionRules) ProtoReflect ¶ added in v0.52.0
func (x *BranchProtectionRules) ProtoReflect() protoreflect.Message
func (*BranchProtectionRules) Reset ¶ added in v0.52.0
func (x *BranchProtectionRules) Reset()
func (*BranchProtectionRules) String ¶ added in v0.52.0
func (x *BranchProtectionRules) String() string
type BranchRecord ¶
BranchRecord holds BranchID with the associated Branch data
type CombinedDiffIterator ¶ added in v0.53.0
type CombinedDiffIterator struct {
// contains filtered or unexported fields
}
CombinedDiffIterator calculates the diff between a commit and a branch, including the staging area of the branch. committedDiffIterator is the DiffIterator between the commit and the HEAD of the branch. stagingIterator is the ValueIterator on the staging area of the branch leftIterator is the ValueIterator on the commit
func NewCombinedDiffIterator ¶ added in v0.53.0
func NewCombinedDiffIterator(committedDiffIterator DiffIterator, leftIterator ValueIterator, stagingIterator ValueIterator) *CombinedDiffIterator
func (*CombinedDiffIterator) Close ¶ added in v0.53.0
func (c *CombinedDiffIterator) Close()
func (*CombinedDiffIterator) Err ¶ added in v0.53.0
func (c *CombinedDiffIterator) Err() error
func (*CombinedDiffIterator) Next ¶ added in v0.53.0
func (c *CombinedDiffIterator) Next() bool
func (*CombinedDiffIterator) SeekGE ¶ added in v0.53.0
func (c *CombinedDiffIterator) SeekGE(id Key)
func (*CombinedDiffIterator) Value ¶ added in v0.53.0
func (c *CombinedDiffIterator) Value() *Diff
type CombinedIterator ¶
type CombinedIterator struct {
// contains filtered or unexported fields
}
CombinedIterator iterates over two listing iterators, in case of duplication (in values or in errors) returns value in iterA
func NewCombinedIterator ¶
func NewCombinedIterator(iterA, iterB ValueIterator) *CombinedIterator
func (*CombinedIterator) Close ¶
func (c *CombinedIterator) Close()
func (*CombinedIterator) Err ¶
func (c *CombinedIterator) Err() error
func (*CombinedIterator) Next ¶
func (c *CombinedIterator) Next() bool
func (*CombinedIterator) SeekGE ¶
func (c *CombinedIterator) SeekGE(id Key)
func (*CombinedIterator) Value ¶
func (c *CombinedIterator) Value() *ValueRecord
type Commit ¶
type Commit struct { Version CommitVersion `db:"version"` Committer string `db:"committer"` Message string `db:"message"` MetaRangeID MetaRangeID `db:"meta_range_id"` CreationDate time.Time `db:"creation_date"` Parents CommitParents `db:"parents"` Metadata Metadata `db:"metadata"` Generation int `db:"generation"` }
Commit represents commit metadata (author, time, MetaRangeID)
type CommitData ¶
type CommitData struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Committer string `protobuf:"bytes,2,opt,name=committer,proto3" json:"committer,omitempty"` Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` CreationDate *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=creation_date,json=creationDate,proto3" json:"creation_date,omitempty"` MetaRangeId string `protobuf:"bytes,5,opt,name=meta_range_id,json=metaRangeId,proto3" json:"meta_range_id,omitempty"` Metadata map[string]string `` /* 157-byte string literal not displayed */ Parents []string `protobuf:"bytes,7,rep,name=parents,proto3" json:"parents,omitempty"` Version int32 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty"` Generation int32 `protobuf:"varint,9,opt,name=generation,proto3" json:"generation,omitempty"` // contains filtered or unexported fields }
func (*CommitData) Descriptor
deprecated
func (*CommitData) Descriptor() ([]byte, []int)
Deprecated: Use CommitData.ProtoReflect.Descriptor instead.
func (*CommitData) GetCommitter ¶
func (x *CommitData) GetCommitter() string
func (*CommitData) GetCreationDate ¶
func (x *CommitData) GetCreationDate() *timestamppb.Timestamp
func (*CommitData) GetGeneration ¶ added in v0.41.1
func (x *CommitData) GetGeneration() int32
func (*CommitData) GetId ¶
func (x *CommitData) GetId() string
func (*CommitData) GetMessage ¶
func (x *CommitData) GetMessage() string
func (*CommitData) GetMetaRangeId ¶
func (x *CommitData) GetMetaRangeId() string
func (*CommitData) GetMetadata ¶
func (x *CommitData) GetMetadata() map[string]string
func (*CommitData) GetParents ¶
func (x *CommitData) GetParents() []string
func (*CommitData) GetVersion ¶ added in v0.40.0
func (x *CommitData) GetVersion() int32
func (*CommitData) ProtoMessage ¶
func (*CommitData) ProtoMessage()
func (*CommitData) ProtoReflect ¶
func (x *CommitData) ProtoReflect() protoreflect.Message
func (*CommitData) Reset ¶
func (x *CommitData) Reset()
func (*CommitData) String ¶
func (x *CommitData) String() string
type CommitID ¶
type CommitID string
CommitID is a content addressable hash representing a Commit object
type CommitIDAndSummary ¶
type CommitIDAndSummary struct { ID CommitID Summary DiffSummary }
type CommitIterator ¶
type CommitIterator interface { Next() bool SeekGE(id CommitID) Value() *CommitRecord Err() error Close() }
type CommitParams ¶
type CommitParams struct { Committer string Message string // Date (Unix Epoch in seconds) is used to override commits creation date Date *int64 Metadata Metadata // SourceMetaRange - If exists, use it directly. Fail if branch has uncommitted changes SourceMetaRange *MetaRangeID }
type CommitParents ¶
type CommitParents []CommitID
func (CommitParents) AsStringSlice ¶
func (cp CommitParents) AsStringSlice() []string
func (CommitParents) Contains ¶
func (cp CommitParents) Contains(commitID CommitID) bool
func (CommitParents) Identity ¶
func (cp CommitParents) Identity() []byte
type CommitRecord ¶
CommitRecord holds CommitID with the associated Commit data
type CommitVersion ¶ added in v0.40.0
type CommitVersion int
CommitVersion used to track changes in Commit schema. Each version is change that a constant describes.
const ( CommitVersionInitial CommitVersion = iota CommitVersionParentSwitch CurrentCommitVersion = CommitVersionParentSwitch )
type CommittedManager ¶
type CommittedManager interface { // Get returns the provided key, if exists, from the provided MetaRangeID Get(ctx context.Context, ns StorageNamespace, rangeID MetaRangeID, key Key) (*Value, error) // Exists returns true if a MetaRange matching ID exists in namespace ns. Exists(ctx context.Context, ns StorageNamespace, id MetaRangeID) (bool, error) // WriteMetaRangeByIterator flushes the iterator to a new MetaRange and returns the created ID. WriteMetaRangeByIterator(ctx context.Context, ns StorageNamespace, it ValueIterator, metadata Metadata) (*MetaRangeID, error) // WriteRange creates a new Range from the iterator values. // Keeps Range closing logic, so might not exhaust the iterator. WriteRange(ctx context.Context, ns StorageNamespace, it ValueIterator) (*RangeInfo, error) // WriteMetaRange creates a new MetaRange from the given Ranges. WriteMetaRange(ctx context.Context, ns StorageNamespace, ranges []*RangeInfo) (*MetaRangeInfo, error) // List takes a given tree and returns an ValueIterator List(ctx context.Context, ns StorageNamespace, rangeID MetaRangeID) (ValueIterator, error) // Diff receives two metaRanges and returns a DiffIterator describing all differences between them. // This is similar to a two-dot diff in git (left..right) Diff(ctx context.Context, ns StorageNamespace, left, right MetaRangeID) (DiffIterator, error) // Compare returns the difference between 'source' and 'destination', relative to a merge base 'base'. // This is similar to a three-dot diff in git. Compare(ctx context.Context, ns StorageNamespace, destination, source, base MetaRangeID) (DiffIterator, error) // Merge applies changes from 'source' to 'destination', relative to a merge base 'base' and // returns the ID of the new metarange. This is similar to a git merge operation. // The resulting tree is expected to be immediately addressable. Merge(ctx context.Context, ns StorageNamespace, destination, source, base MetaRangeID, strategy MergeStrategy) (MetaRangeID, error) // Commit is the act of taking an existing metaRange (snapshot) and applying a set of changes to it. // A change is either an entity to write/overwrite, or a tombstone to mark a deletion // it returns a new MetaRangeID that is expected to be immediately addressable Commit(ctx context.Context, ns StorageNamespace, baseMetaRangeID MetaRangeID, changes ValueIterator) (MetaRangeID, DiffSummary, error) // GetMetaRange returns information where metarangeID is stored. GetMetaRange(ctx context.Context, ns StorageNamespace, metaRangeID MetaRangeID) (MetaRangeAddress, error) // GetRange returns information where rangeID is stored. GetRange(ctx context.Context, ns StorageNamespace, rangeID RangeID) (RangeAddress, error) }
CommittedManager reads and applies committed snapshots it is responsible for de-duping them, persisting them and providing basic diff, merge and list capabilities
type DBGraveler ¶ added in v0.69.0
type DBGraveler struct { CommittedManager CommittedManager StagingManager StagingManager RefManager RefManager // contains filtered or unexported fields }
func NewDBGraveler ¶ added in v0.69.0
func NewDBGraveler(branchLocker BranchLocker, committedManager CommittedManager, stagingManager StagingManager, refManager RefManager, gcManager GarbageCollectionManager, protectedBranchesManager ProtectedBranchesManager) *DBGraveler
func (*DBGraveler) AddCommit ¶ added in v0.69.0
func (g *DBGraveler) AddCommit(ctx context.Context, repositoryID RepositoryID, commit Commit) (CommitID, error)
func (*DBGraveler) AddCommitToBranchHead ¶ added in v0.69.0
func (g *DBGraveler) AddCommitToBranchHead(ctx context.Context, repositoryID RepositoryID, branchID BranchID, commit Commit) (CommitID, error)
func (*DBGraveler) Commit ¶ added in v0.69.0
func (g *DBGraveler) Commit(ctx context.Context, repositoryID RepositoryID, branchID BranchID, params CommitParams) (CommitID, error)
func (*DBGraveler) Compare ¶ added in v0.69.0
func (g *DBGraveler) Compare(ctx context.Context, repositoryID RepositoryID, left, right Ref) (DiffIterator, error)
func (*DBGraveler) CreateBareRepository ¶ added in v0.69.0
func (g *DBGraveler) CreateBareRepository(ctx context.Context, repositoryID RepositoryID, storageNamespace StorageNamespace, defaultBranchID BranchID) (*Repository, error)
func (*DBGraveler) CreateBranch ¶ added in v0.69.0
func (g *DBGraveler) CreateBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref) (*Branch, error)
func (*DBGraveler) CreateBranchProtectionRule ¶ added in v0.69.0
func (g *DBGraveler) CreateBranchProtectionRule(ctx context.Context, repositoryID RepositoryID, pattern string, blockedActions []BranchProtectionBlockedAction) error
func (*DBGraveler) CreateRepository ¶ added in v0.69.0
func (g *DBGraveler) CreateRepository(ctx context.Context, repositoryID RepositoryID, storageNamespace StorageNamespace, branchID BranchID) (*Repository, error)
func (*DBGraveler) CreateTag ¶ added in v0.69.0
func (g *DBGraveler) CreateTag(ctx context.Context, repositoryID RepositoryID, tagID TagID, commitID CommitID) error
func (*DBGraveler) Delete ¶ added in v0.69.0
func (g *DBGraveler) Delete(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
func (*DBGraveler) DeleteBranch ¶ added in v0.69.0
func (g *DBGraveler) DeleteBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) error
func (*DBGraveler) DeleteBranchProtectionRule ¶ added in v0.69.0
func (g *DBGraveler) DeleteBranchProtectionRule(ctx context.Context, repositoryID RepositoryID, pattern string) error
func (*DBGraveler) DeleteRepository ¶ added in v0.69.0
func (g *DBGraveler) DeleteRepository(ctx context.Context, repositoryID RepositoryID) error
func (*DBGraveler) DeleteTag ¶ added in v0.69.0
func (g *DBGraveler) DeleteTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) error
func (*DBGraveler) Dereference ¶ added in v0.69.0
func (g *DBGraveler) Dereference(ctx context.Context, repositoryID RepositoryID, ref Ref) (*ResolvedRef, error)
func (*DBGraveler) Diff ¶ added in v0.69.0
func (g *DBGraveler) Diff(ctx context.Context, repositoryID RepositoryID, left, right Ref) (DiffIterator, error)
func (*DBGraveler) DiffUncommitted ¶ added in v0.69.0
func (g *DBGraveler) DiffUncommitted(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (DiffIterator, error)
func (*DBGraveler) DumpBranches ¶ added in v0.69.0
func (g *DBGraveler) DumpBranches(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
func (*DBGraveler) DumpCommits ¶ added in v0.69.0
func (g *DBGraveler) DumpCommits(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
func (*DBGraveler) DumpTags ¶ added in v0.69.0
func (g *DBGraveler) DumpTags(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
func (*DBGraveler) Get ¶ added in v0.69.0
func (g *DBGraveler) Get(ctx context.Context, repositoryID RepositoryID, ref Ref, key Key) (*Value, error)
func (*DBGraveler) GetBranch ¶ added in v0.69.0
func (g *DBGraveler) GetBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (*Branch, error)
func (*DBGraveler) GetBranchProtectionRules ¶ added in v0.69.0
func (g *DBGraveler) GetBranchProtectionRules(ctx context.Context, repositoryID RepositoryID) (*BranchProtectionRules, error)
func (*DBGraveler) GetCommit ¶ added in v0.69.0
func (g *DBGraveler) GetCommit(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (*Commit, error)
func (*DBGraveler) GetGarbageCollectionRules ¶ added in v0.69.0
func (g *DBGraveler) GetGarbageCollectionRules(ctx context.Context, repositoryID RepositoryID) (*GarbageCollectionRules, error)
func (*DBGraveler) GetMetaRange ¶ added in v0.69.0
func (g *DBGraveler) GetMetaRange(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) (MetaRangeAddress, error)
func (*DBGraveler) GetRange ¶ added in v0.69.0
func (g *DBGraveler) GetRange(ctx context.Context, repositoryID RepositoryID, rangeID RangeID) (RangeAddress, error)
func (*DBGraveler) GetRepository ¶ added in v0.69.0
func (g *DBGraveler) GetRepository(ctx context.Context, repositoryID RepositoryID) (*Repository, error)
func (*DBGraveler) GetStagingToken ¶ added in v0.69.0
func (g *DBGraveler) GetStagingToken(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (*StagingToken, error)
func (*DBGraveler) GetTag ¶ added in v0.69.0
func (g *DBGraveler) GetTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) (*CommitID, error)
func (*DBGraveler) List ¶ added in v0.69.0
func (g *DBGraveler) List(ctx context.Context, repositoryID RepositoryID, ref Ref) (ValueIterator, error)
func (*DBGraveler) ListBranches ¶ added in v0.69.0
func (g *DBGraveler) ListBranches(ctx context.Context, repositoryID RepositoryID) (BranchIterator, error)
func (*DBGraveler) ListRepositories ¶ added in v0.69.0
func (g *DBGraveler) ListRepositories(ctx context.Context) (RepositoryIterator, error)
func (*DBGraveler) ListTags ¶ added in v0.69.0
func (g *DBGraveler) ListTags(ctx context.Context, repositoryID RepositoryID) (TagIterator, error)
func (*DBGraveler) LoadBranches ¶ added in v0.69.0
func (g *DBGraveler) LoadBranches(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
func (*DBGraveler) LoadCommits ¶ added in v0.69.0
func (g *DBGraveler) LoadCommits(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
func (*DBGraveler) LoadTags ¶ added in v0.69.0
func (g *DBGraveler) LoadTags(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
func (*DBGraveler) Log ¶ added in v0.69.0
func (g *DBGraveler) Log(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (CommitIterator, error)
func (*DBGraveler) Merge ¶ added in v0.69.0
func (g *DBGraveler) Merge(ctx context.Context, repositoryID RepositoryID, destination BranchID, source Ref, commitParams CommitParams, strategy string) (CommitID, error)
func (*DBGraveler) ParseRef ¶ added in v0.69.0
func (g *DBGraveler) ParseRef(ref Ref) (RawRef, error)
func (*DBGraveler) Reset ¶ added in v0.69.0
func (g *DBGraveler) Reset(ctx context.Context, repositoryID RepositoryID, branchID BranchID) error
func (*DBGraveler) ResetKey ¶ added in v0.69.0
func (g *DBGraveler) ResetKey(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
func (*DBGraveler) ResetPrefix ¶ added in v0.69.0
func (g *DBGraveler) ResetPrefix(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
func (*DBGraveler) ResolveRawRef ¶ added in v0.69.0
func (g *DBGraveler) ResolveRawRef(ctx context.Context, repositoryID RepositoryID, rawRef RawRef) (*ResolvedRef, error)
func (*DBGraveler) Revert ¶ added in v0.69.0
func (g *DBGraveler) Revert(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref, parentNumber int, commitParams CommitParams) (CommitID, error)
Revert creates a reverse patch to the commit given as 'ref', and applies it as a new commit on the given branch. This is implemented by merging the parent of 'ref' into the branch, with 'ref' as the merge base. Example: consider the following tree: C1 -> C2 -> C3, with the branch pointing at C3. To revert C2, we merge C1 into the branch, with C2 as the merge base. That is, try to apply the diff from C2 to C1 on the tip of the branch. If the commit is a merge commit, 'parentNumber' is the parent number (1-based) relative to which the revert is done.
func (*DBGraveler) SaveGarbageCollectionCommits ¶ added in v0.69.0
func (g *DBGraveler) SaveGarbageCollectionCommits(ctx context.Context, repositoryID RepositoryID, previousRunID string) (*GarbageCollectionRunMetadata, error)
func (*DBGraveler) Set ¶ added in v0.69.0
func (g *DBGraveler) Set(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key, value Value, writeConditions ...WriteConditionOption) error
func (*DBGraveler) SetGarbageCollectionRules ¶ added in v0.69.0
func (g *DBGraveler) SetGarbageCollectionRules(ctx context.Context, repositoryID RepositoryID, rules *GarbageCollectionRules) error
func (*DBGraveler) SetHooksHandler ¶ added in v0.69.0
func (g *DBGraveler) SetHooksHandler(handler HooksHandler)
func (*DBGraveler) UpdateBranch ¶ added in v0.69.0
func (g *DBGraveler) UpdateBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref) (*Branch, error)
func (*DBGraveler) WriteMetaRange ¶ added in v0.69.0
func (g *DBGraveler) WriteMetaRange(ctx context.Context, repositoryID RepositoryID, ranges []*RangeInfo) (*MetaRangeInfo, error)
func (*DBGraveler) WriteMetaRangeByIterator ¶ added in v0.69.0
func (g *DBGraveler) WriteMetaRangeByIterator(ctx context.Context, repositoryID RepositoryID, it ValueIterator) (*MetaRangeID, error)
func (*DBGraveler) WriteRange ¶ added in v0.69.0
func (g *DBGraveler) WriteRange(ctx context.Context, repositoryID RepositoryID, it ValueIterator) (*RangeInfo, error)
type Diff ¶
type Diff struct { Type DiffType Key Key Value *Value LeftIdentity []byte // the Identity of the value on the left side of the diff }
Diff represents a change in value based on key
type DiffIterator ¶
func NewUncommittedDiffIterator ¶
func NewUncommittedDiffIterator(ctx context.Context, committedList ValueIterator, uncommittedList ValueIterator, sn StorageNamespace, metaRangeID MetaRangeID) DiffIterator
NewUncommittedDiffIterator lists uncommitted changes as a diff. If `metaRangeID` is empty then there is no commit and it returns all objects as added
type DiffSummary ¶
type Dumper ¶
type Dumper interface { // DumpCommits iterates through all commits and dumps them in Graveler format DumpCommits(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error) // DumpBranches iterates through all branches and dumps them in Graveler format DumpBranches(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error) // DumpTags iterates through all tags and dumps them in Graveler format DumpTags(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error) }
type EventType ¶
type EventType string
const ( EventTypePreCommit EventType = "pre-commit" EventTypePostCommit EventType = "post-commit" EventTypePreMerge EventType = "pre-merge" EventTypePostMerge EventType = "post-merge" EventTypePreCreateTag EventType = "pre-create-tag" EventTypePostCreateTag EventType = "post-create-tag" EventTypePreDeleteTag EventType = "pre-delete-tag" EventTypePostDeleteTag EventType = "post-delete-tag" EventTypePreCreateBranch EventType = "pre-create-branch" EventTypePostCreateBranch EventType = "post-create-branch" EventTypePreDeleteBranch EventType = "pre-delete-branch" EventTypePostDeleteBranch EventType = "post-delete-branch" RunIDTimeLayout = "20060102150405" UnixYear3000 = 32500915200 )
type GarbageCollectionManager ¶ added in v0.43.0
type GarbageCollectionManager interface { GetRules(ctx context.Context, storageNamespace StorageNamespace) (*GarbageCollectionRules, error) SaveRules(ctx context.Context, storageNamespace StorageNamespace, rules *GarbageCollectionRules) error SaveGarbageCollectionCommits(ctx context.Context, storageNamespace StorageNamespace, repositoryID RepositoryID, rules *GarbageCollectionRules, previouslyExpiredCommits []CommitID) (string, error) GetRunExpiredCommits(ctx context.Context, storageNamespace StorageNamespace, runID string) ([]CommitID, error) GetCommitsCSVLocation(runID string, sn StorageNamespace) (string, error) GetAddressesLocation(sn StorageNamespace) (string, error) }
type GarbageCollectionRules ¶ added in v0.43.0
type GarbageCollectionRules struct { DefaultRetentionDays int32 `protobuf:"varint,1,opt,name=default_retention_days,json=defaultRetentionDays,proto3" json:"default_retention_days,omitempty"` BranchRetentionDays map[string]int32 `` /* 209-byte string literal not displayed */ // contains filtered or unexported fields }
func (*GarbageCollectionRules) Descriptor
deprecated
added in
v0.43.0
func (*GarbageCollectionRules) Descriptor() ([]byte, []int)
Deprecated: Use GarbageCollectionRules.ProtoReflect.Descriptor instead.
func (*GarbageCollectionRules) GetBranchRetentionDays ¶ added in v0.43.0
func (x *GarbageCollectionRules) GetBranchRetentionDays() map[string]int32
func (*GarbageCollectionRules) GetDefaultRetentionDays ¶ added in v0.43.0
func (x *GarbageCollectionRules) GetDefaultRetentionDays() int32
func (*GarbageCollectionRules) ProtoMessage ¶ added in v0.43.0
func (*GarbageCollectionRules) ProtoMessage()
func (*GarbageCollectionRules) ProtoReflect ¶ added in v0.43.0
func (x *GarbageCollectionRules) ProtoReflect() protoreflect.Message
func (*GarbageCollectionRules) Reset ¶ added in v0.43.0
func (x *GarbageCollectionRules) Reset()
func (*GarbageCollectionRules) String ¶ added in v0.43.0
func (x *GarbageCollectionRules) String() string
type GarbageCollectionRunMetadata ¶ added in v0.44.0
type GarbageCollectionRunMetadata struct { RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` CommitsCsvLocation string `protobuf:"bytes,2,opt,name=Commits_csv_location,json=CommitsCsvLocation,proto3" json:"Commits_csv_location,omitempty"` AddressLocation string `protobuf:"bytes,3,opt,name=Address_location,json=AddressLocation,proto3" json:"Address_location,omitempty"` // contains filtered or unexported fields }
func (*GarbageCollectionRunMetadata) Descriptor
deprecated
added in
v0.44.0
func (*GarbageCollectionRunMetadata) Descriptor() ([]byte, []int)
Deprecated: Use GarbageCollectionRunMetadata.ProtoReflect.Descriptor instead.
func (*GarbageCollectionRunMetadata) GetAddressLocation ¶ added in v0.44.0
func (x *GarbageCollectionRunMetadata) GetAddressLocation() string
func (*GarbageCollectionRunMetadata) GetCommitsCsvLocation ¶ added in v0.44.0
func (x *GarbageCollectionRunMetadata) GetCommitsCsvLocation() string
func (*GarbageCollectionRunMetadata) GetRunId ¶ added in v0.44.0
func (x *GarbageCollectionRunMetadata) GetRunId() string
func (*GarbageCollectionRunMetadata) ProtoMessage ¶ added in v0.44.0
func (*GarbageCollectionRunMetadata) ProtoMessage()
func (*GarbageCollectionRunMetadata) ProtoReflect ¶ added in v0.44.0
func (x *GarbageCollectionRunMetadata) ProtoReflect() protoreflect.Message
func (*GarbageCollectionRunMetadata) Reset ¶ added in v0.44.0
func (x *GarbageCollectionRunMetadata) Reset()
func (*GarbageCollectionRunMetadata) String ¶ added in v0.44.0
func (x *GarbageCollectionRunMetadata) String() string
type HookAbortError ¶
HookAbortError abort by hook error, holds the event type with the run id to trace back the run
func (*HookAbortError) Error ¶
func (e *HookAbortError) Error() string
func (*HookAbortError) Unwrap ¶
func (e *HookAbortError) Unwrap() error
type HookRecord ¶
type HookRecord struct { // Required fields for all event types: RunID string EventType EventType RepositoryID RepositoryID StorageNamespace StorageNamespace // The reference which the actions files are read from SourceRef Ref // Event specific fields: // Relevant for all event types except tags. For merge events this will be the ID of the destination branch BranchID BranchID // Relevant only for commit and merge events. In both it will contain the new commit data created from the operation Commit Commit // Not relevant in delete branch. In commit and merge will not exist in pre-action. In post actions will contain the new commit ID CommitID CommitID // Exists only in post actions. Contains the ID of the pre-action associated with this post-action PreRunID string // Exists only in tag actions. TagID TagID }
HookRecord is an aggregation of all necessary fields for all event types
type HooksHandler ¶
type HooksHandler interface { PreCommitHook(ctx context.Context, record HookRecord) error PostCommitHook(ctx context.Context, record HookRecord) error PreMergeHook(ctx context.Context, record HookRecord) error PostMergeHook(ctx context.Context, record HookRecord) error PreCreateTagHook(ctx context.Context, record HookRecord) error PostCreateTagHook(ctx context.Context, record HookRecord) PreDeleteTagHook(ctx context.Context, record HookRecord) error PostDeleteTagHook(ctx context.Context, record HookRecord) PreCreateBranchHook(ctx context.Context, record HookRecord) error PostCreateBranchHook(ctx context.Context, record HookRecord) PreDeleteBranchHook(ctx context.Context, record HookRecord) error PostDeleteBranchHook(ctx context.Context, record HookRecord) // NewRunID TODO (niro): WA for now until KV feature complete NewRunID() string }
type HooksNoOp ¶
type HooksNoOp struct{}
func (*HooksNoOp) PostCommitHook ¶
func (h *HooksNoOp) PostCommitHook(context.Context, HookRecord) error
func (*HooksNoOp) PostCreateBranchHook ¶ added in v0.62.0
func (h *HooksNoOp) PostCreateBranchHook(context.Context, HookRecord)
func (*HooksNoOp) PostCreateTagHook ¶ added in v0.62.0
func (h *HooksNoOp) PostCreateTagHook(context.Context, HookRecord)
func (*HooksNoOp) PostDeleteBranchHook ¶ added in v0.62.0
func (h *HooksNoOp) PostDeleteBranchHook(context.Context, HookRecord)
func (*HooksNoOp) PostDeleteTagHook ¶ added in v0.62.0
func (h *HooksNoOp) PostDeleteTagHook(context.Context, HookRecord)
func (*HooksNoOp) PostMergeHook ¶
func (h *HooksNoOp) PostMergeHook(context.Context, HookRecord) error
func (*HooksNoOp) PreCommitHook ¶
func (h *HooksNoOp) PreCommitHook(context.Context, HookRecord) error
func (*HooksNoOp) PreCreateBranchHook ¶ added in v0.62.0
func (h *HooksNoOp) PreCreateBranchHook(context.Context, HookRecord) error
func (*HooksNoOp) PreCreateTagHook ¶ added in v0.62.0
func (h *HooksNoOp) PreCreateTagHook(context.Context, HookRecord) error
func (*HooksNoOp) PreDeleteBranchHook ¶ added in v0.62.0
func (h *HooksNoOp) PreDeleteBranchHook(context.Context, HookRecord) error
func (*HooksNoOp) PreDeleteTagHook ¶ added in v0.62.0
func (h *HooksNoOp) PreDeleteTagHook(context.Context, HookRecord) error
func (*HooksNoOp) PreMergeHook ¶
func (h *HooksNoOp) PreMergeHook(context.Context, HookRecord) error
type KVGraveler ¶ added in v0.69.0
type KVGraveler struct { StagingManager StagingManager // contains filtered or unexported fields }
func NewKVGraveler ¶ added in v0.69.0
func NewKVGraveler(branchLocker BranchLocker, committedManager CommittedManager, stagingManager StagingManager, refManager RefManager, gcManager GarbageCollectionManager, protectedBranchesManager ProtectedBranchesManager) *KVGraveler
func (*KVGraveler) AddCommit ¶ added in v0.69.0
func (g *KVGraveler) AddCommit(ctx context.Context, repositoryID RepositoryID, commit Commit) (CommitID, error)
func (*KVGraveler) AddCommitToBranchHead ¶ added in v0.69.0
func (g *KVGraveler) AddCommitToBranchHead(ctx context.Context, repositoryID RepositoryID, branchID BranchID, commit Commit) (CommitID, error)
func (*KVGraveler) Commit ¶ added in v0.69.0
func (g *KVGraveler) Commit(ctx context.Context, repositoryID RepositoryID, branchID BranchID, params CommitParams) (CommitID, error)
func (*KVGraveler) Compare ¶ added in v0.69.0
func (g *KVGraveler) Compare(ctx context.Context, repositoryID RepositoryID, left, right Ref) (DiffIterator, error)
func (*KVGraveler) CreateBareRepository ¶ added in v0.69.0
func (g *KVGraveler) CreateBareRepository(ctx context.Context, repositoryID RepositoryID, storageNamespace StorageNamespace, defaultBranchID BranchID) (*Repository, error)
func (*KVGraveler) CreateBranch ¶ added in v0.69.0
func (g *KVGraveler) CreateBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref) (*Branch, error)
func (*KVGraveler) CreateBranchProtectionRule ¶ added in v0.69.0
func (g *KVGraveler) CreateBranchProtectionRule(ctx context.Context, repositoryID RepositoryID, pattern string, blockedActions []BranchProtectionBlockedAction) error
func (*KVGraveler) CreateRepository ¶ added in v0.69.0
func (g *KVGraveler) CreateRepository(ctx context.Context, repositoryID RepositoryID, storageNamespace StorageNamespace, branchID BranchID) (*Repository, error)
func (*KVGraveler) CreateTag ¶ added in v0.69.0
func (g *KVGraveler) CreateTag(ctx context.Context, repositoryID RepositoryID, tagID TagID, commitID CommitID) error
func (*KVGraveler) Delete ¶ added in v0.69.0
func (g *KVGraveler) Delete(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
func (*KVGraveler) DeleteBranch ¶ added in v0.69.0
func (g *KVGraveler) DeleteBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) error
func (*KVGraveler) DeleteBranchProtectionRule ¶ added in v0.69.0
func (g *KVGraveler) DeleteBranchProtectionRule(ctx context.Context, repositoryID RepositoryID, pattern string) error
func (*KVGraveler) DeleteRepository ¶ added in v0.69.0
func (g *KVGraveler) DeleteRepository(ctx context.Context, repositoryID RepositoryID) error
func (*KVGraveler) DeleteTag ¶ added in v0.69.0
func (g *KVGraveler) DeleteTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) error
func (*KVGraveler) Dereference ¶ added in v0.69.0
func (g *KVGraveler) Dereference(ctx context.Context, repositoryID RepositoryID, ref Ref) (*ResolvedRef, error)
func (*KVGraveler) Diff ¶ added in v0.69.0
func (g *KVGraveler) Diff(ctx context.Context, repositoryID RepositoryID, left, right Ref) (DiffIterator, error)
func (*KVGraveler) DiffUncommitted ¶ added in v0.69.0
func (g *KVGraveler) DiffUncommitted(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (DiffIterator, error)
func (*KVGraveler) DumpBranches ¶ added in v0.69.0
func (g *KVGraveler) DumpBranches(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
func (*KVGraveler) DumpCommits ¶ added in v0.69.0
func (g *KVGraveler) DumpCommits(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
func (*KVGraveler) DumpTags ¶ added in v0.69.0
func (g *KVGraveler) DumpTags(ctx context.Context, repositoryID RepositoryID) (*MetaRangeID, error)
func (*KVGraveler) Get ¶ added in v0.69.0
func (g *KVGraveler) Get(ctx context.Context, repositoryID RepositoryID, ref Ref, key Key) (*Value, error)
func (*KVGraveler) GetBranch ¶ added in v0.69.0
func (g *KVGraveler) GetBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (*Branch, error)
func (*KVGraveler) GetBranchProtectionRules ¶ added in v0.69.0
func (g *KVGraveler) GetBranchProtectionRules(ctx context.Context, repositoryID RepositoryID) (*BranchProtectionRules, error)
func (*KVGraveler) GetCommit ¶ added in v0.69.0
func (g *KVGraveler) GetCommit(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (*Commit, error)
func (*KVGraveler) GetGarbageCollectionRules ¶ added in v0.69.0
func (g *KVGraveler) GetGarbageCollectionRules(ctx context.Context, repositoryID RepositoryID) (*GarbageCollectionRules, error)
func (*KVGraveler) GetMetaRange ¶ added in v0.69.0
func (g *KVGraveler) GetMetaRange(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) (MetaRangeAddress, error)
func (*KVGraveler) GetRange ¶ added in v0.69.0
func (g *KVGraveler) GetRange(ctx context.Context, repositoryID RepositoryID, rangeID RangeID) (RangeAddress, error)
func (*KVGraveler) GetRepository ¶ added in v0.69.0
func (g *KVGraveler) GetRepository(ctx context.Context, repositoryID RepositoryID) (*Repository, error)
func (*KVGraveler) GetStagingToken ¶ added in v0.69.0
func (g *KVGraveler) GetStagingToken(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (*StagingToken, error)
func (*KVGraveler) GetTag ¶ added in v0.69.0
func (g *KVGraveler) GetTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) (*CommitID, error)
func (*KVGraveler) List ¶ added in v0.69.0
func (g *KVGraveler) List(ctx context.Context, repositoryID RepositoryID, ref Ref) (ValueIterator, error)
func (*KVGraveler) ListBranches ¶ added in v0.69.0
func (g *KVGraveler) ListBranches(ctx context.Context, repositoryID RepositoryID) (BranchIterator, error)
func (*KVGraveler) ListRepositories ¶ added in v0.69.0
func (g *KVGraveler) ListRepositories(ctx context.Context) (RepositoryIterator, error)
func (*KVGraveler) ListTags ¶ added in v0.69.0
func (g *KVGraveler) ListTags(ctx context.Context, repositoryID RepositoryID) (TagIterator, error)
func (*KVGraveler) LoadBranches ¶ added in v0.69.0
func (g *KVGraveler) LoadBranches(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
func (*KVGraveler) LoadCommits ¶ added in v0.69.0
func (g *KVGraveler) LoadCommits(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
func (*KVGraveler) LoadTags ¶ added in v0.69.0
func (g *KVGraveler) LoadTags(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error
func (*KVGraveler) Log ¶ added in v0.69.0
func (g *KVGraveler) Log(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (CommitIterator, error)
func (*KVGraveler) Merge ¶ added in v0.69.0
func (g *KVGraveler) Merge(ctx context.Context, repositoryID RepositoryID, destination BranchID, source Ref, commitParams CommitParams, strategy string) (CommitID, error)
func (*KVGraveler) ParseRef ¶ added in v0.69.0
func (g *KVGraveler) ParseRef(ref Ref) (RawRef, error)
func (*KVGraveler) Reset ¶ added in v0.69.0
func (g *KVGraveler) Reset(ctx context.Context, repositoryID RepositoryID, branchID BranchID) error
func (*KVGraveler) ResetKey ¶ added in v0.69.0
func (g *KVGraveler) ResetKey(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
func (*KVGraveler) ResetPrefix ¶ added in v0.69.0
func (g *KVGraveler) ResetPrefix(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error
func (*KVGraveler) ResolveRawRef ¶ added in v0.69.0
func (g *KVGraveler) ResolveRawRef(ctx context.Context, repositoryID RepositoryID, rawRef RawRef) (*ResolvedRef, error)
func (*KVGraveler) Revert ¶ added in v0.69.0
func (g *KVGraveler) Revert(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref, parentNumber int, commitParams CommitParams) (CommitID, error)
Revert creates a reverse patch to the commit given as 'ref', and applies it as a new commit on the given branch. This is implemented by merging the parent of 'ref' into the branch, with 'ref' as the merge base. Example: consider the following tree: C1 -> C2 -> C3, with the branch pointing at C3. To revert C2, we merge C1 into the branch, with C2 as the merge base. That is, try to apply the diff from C2 to C1 on the tip of the branch. If the commit is a merge commit, 'parentNumber' is the parent number (1-based) relative to which the revert is done.
func (*KVGraveler) SaveGarbageCollectionCommits ¶ added in v0.69.0
func (g *KVGraveler) SaveGarbageCollectionCommits(ctx context.Context, repositoryID RepositoryID, previousRunID string) (*GarbageCollectionRunMetadata, error)
func (*KVGraveler) Set ¶ added in v0.69.0
func (g *KVGraveler) Set(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key, value Value, writeConditions ...WriteConditionOption) error
func (*KVGraveler) SetGarbageCollectionRules ¶ added in v0.69.0
func (g *KVGraveler) SetGarbageCollectionRules(ctx context.Context, repositoryID RepositoryID, rules *GarbageCollectionRules) error
func (*KVGraveler) SetHooksHandler ¶ added in v0.69.0
func (g *KVGraveler) SetHooksHandler(handler HooksHandler)
func (*KVGraveler) UpdateBranch ¶ added in v0.69.0
func (g *KVGraveler) UpdateBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref) (*Branch, error)
func (*KVGraveler) WriteMetaRange ¶ added in v0.69.0
func (g *KVGraveler) WriteMetaRange(ctx context.Context, repositoryID RepositoryID, ranges []*RangeInfo) (*MetaRangeInfo, error)
func (*KVGraveler) WriteMetaRangeByIterator ¶ added in v0.69.0
func (g *KVGraveler) WriteMetaRangeByIterator(ctx context.Context, repositoryID RepositoryID, it ValueIterator) (*MetaRangeID, error)
func (*KVGraveler) WriteRange ¶ added in v0.69.0
func (g *KVGraveler) WriteRange(ctx context.Context, repositoryID RepositoryID, it ValueIterator) (*RangeInfo, error)
type KeyValueStore ¶
type KeyValueStore interface { // Get returns value from repository / reference by key, nil value is a valid value for tombstone // returns error if value does not exist Get(ctx context.Context, repositoryID RepositoryID, ref Ref, key Key) (*Value, error) // Set stores value on repository / branch by key. nil value is a valid value for tombstone Set(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key, value Value, writeConditions ...WriteConditionOption) error // Delete value from repository / branch by key Delete(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error // List lists values on repository / ref List(ctx context.Context, repositoryID RepositoryID, ref Ref) (ValueIterator, error) }
type Loader ¶
type Loader interface { // LoadCommits iterates through all commits in Graveler format and loads them into repositoryID LoadCommits(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error // LoadBranches iterates through all branches in Graveler format and loads them into repositoryID LoadBranches(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error // LoadTags iterates through all tags in Graveler format and loads them into repositoryID LoadTags(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) error }
type MergeStrategy ¶ added in v0.61.0
type MergeStrategy int
MergeStrategy changes from dest or source are automatically overridden in case of a conflict
const ( MergeStrategyNone MergeStrategy = iota MergeStrategyDest MergeStrategySource )
type MetaRangeAddress ¶ added in v0.63.0
type MetaRangeAddress string
MetaRangeAddress is the URI of a metarange file.
type MetaRangeID ¶
type MetaRangeID string
MetaRangeID represents a snapshot of the MetaRange, referenced by a commit
type MetaRangeInfo ¶
type MetaRangeInfo struct { // ID is the identifier for the written MetaRange. // Calculated by an hash function to all keys and values' identity. ID MetaRangeID }
MetaRangeInfo contains information on a MetaRange
type Plumbing ¶
type Plumbing interface { // GetMetaRange returns information where metarangeID is stored. GetMetaRange(ctx context.Context, repositoryID RepositoryID, metaRangeID MetaRangeID) (MetaRangeAddress, error) // GetRange returns information where rangeID is stored. GetRange(ctx context.Context, repositoryID RepositoryID, rangeID RangeID) (RangeAddress, error) // WriteRange creates a new Range from the iterator values. // Keeps Range closing logic, so might not flush all values to the range. WriteRange(ctx context.Context, repositoryID RepositoryID, it ValueIterator) (*RangeInfo, error) // WriteMetaRange creates a new MetaRange from the given Ranges. WriteMetaRange(ctx context.Context, repositoryID RepositoryID, ranges []*RangeInfo) (*MetaRangeInfo, error) }
Plumbing includes commands for fiddling more directly with graveler implementation internals.
type ProtectedBranchesManager ¶ added in v0.52.0
type ProtectedBranchesManager interface { // Add creates a rule for the given name pattern, blocking the given actions. // Returns ErrRuleAlreadyExists if there is already a rule for the given pattern. Add(ctx context.Context, repositoryID RepositoryID, branchNamePattern string, blockedActions []BranchProtectionBlockedAction) error // Delete deletes the rule for the given name pattern, or returns ErrRuleNotExists if there is no such rule. Delete(ctx context.Context, repositoryID RepositoryID, branchNamePattern string) error // Get returns the list of blocked actions for the given name pattern, or nil if no rule was defined for the pattern. Get(ctx context.Context, repositoryID RepositoryID, branchNamePattern string) ([]BranchProtectionBlockedAction, error) // GetRules returns all branch protection rules for the repository GetRules(ctx context.Context, repositoryID RepositoryID) (*BranchProtectionRules, error) // IsBlocked returns whether the action is blocked by any branch protection rule matching the given branch. IsBlocked(ctx context.Context, repositoryID RepositoryID, branchID BranchID, action BranchProtectionBlockedAction) (bool, error) }
type RangeAddress ¶ added in v0.63.0
type RangeAddress string
RangeAddress is the URI of a range file.
type RangeID ¶
type RangeID string
RangeID represents a part of a MetaRange, useful only for plumbing.
type RangeInfo ¶
type RangeInfo struct { // ID is the identifier for the written Range. // Calculated by a hash function to all keys and values' identity. ID RangeID // MinKey is the first key in the Range. MinKey Key // MaxKey is the last key in the Range. MaxKey Key // Count is the number of records in the Range. Count int // EstimatedRangeSizeBytes is Approximate size of each Range EstimatedRangeSizeBytes uint64 }
RangeInfo contains information on a Range
type RawRef ¶ added in v0.44.1
type RawRef struct { BaseRef string Modifiers []RefModifier }
RawRef is a parsed Ref that includes 'BaseRef' that holds the branch/tag/hash and a list of
ordered modifiers that applied to the reference.
Example: master~2 will be parsed into {BaseRef:"master", Modifiers:[{Type:RefModTypeTilde, Value:2}]}
type RefManager ¶
type RefManager interface { // GetRepository returns the Repository metadata object for the given RepositoryID GetRepository(ctx context.Context, repositoryID RepositoryID) (*Repository, error) // CreateRepository stores a new Repository under RepositoryID with the given Branch as default branch CreateRepository(ctx context.Context, repositoryID RepositoryID, repository Repository, token StagingToken) error // CreateBareRepository stores a new repository under RepositoryID without creating an initial commit and branch CreateBareRepository(ctx context.Context, repositoryID RepositoryID, repository Repository) error // ListRepositories lists repositories ListRepositories(ctx context.Context) (RepositoryIterator, error) // DeleteRepository deletes the repository DeleteRepository(ctx context.Context, repositoryID RepositoryID) error // ParseRef returns parsed 'ref' information as RawRef ParseRef(ref Ref) (RawRef, error) // ResolveRawRef returns the ResolvedRef matching the given RawRef ResolveRawRef(ctx context.Context, repositoryID RepositoryID, rawRef RawRef) (*ResolvedRef, error) // GetBranch returns the Branch metadata object for the given BranchID GetBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (*Branch, error) // CreateBranch creates a branch with the given id and Branch metadata CreateBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, branch Branch) error // SetBranch points the given BranchID at the given Branch metadata SetBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, branch Branch) error // DeleteBranch deletes the branch DeleteBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) error // ListBranches lists branches ListBranches(ctx context.Context, repositoryID RepositoryID) (BranchIterator, error) // GetTag returns the Tag metadata object for the given TagID GetTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) (*CommitID, error) // CreateTag create a given tag pointing to a commit CreateTag(ctx context.Context, repositoryID RepositoryID, tagID TagID, commitID CommitID) error // DeleteTag deletes the tag DeleteTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) error // ListTags lists tags ListTags(ctx context.Context, repositoryID RepositoryID) (TagIterator, error) // GetCommit returns the Commit metadata object for the given CommitID. GetCommit(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (*Commit, error) // AddCommit stores the Commit object, returning its ID AddCommit(ctx context.Context, repositoryID RepositoryID, commit Commit) (CommitID, error) // FindMergeBase returns the merge-base for the given CommitIDs // see: https://git-scm.com/docs/git-merge-base // and internally: https://github.com/treeverse/lakeFS/blob/09954804baeb36ada74fa17d8fdc13a38552394e/index/dag/commits.go FindMergeBase(ctx context.Context, repositoryID RepositoryID, commitIDs ...CommitID) (*Commit, error) // Log returns an iterator starting at commit ID up to repository root Log(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (CommitIterator, error) // ListCommits returns an iterator over all known commits, ordered by their commit ID ListCommits(ctx context.Context, repositoryID RepositoryID) (CommitIterator, error) // FillGenerations computes and updates the generation field for all commits in a repository. // It should be used for restoring commits from a commit-dump which was performed before the field was introduced. FillGenerations(ctx context.Context, repositoryID RepositoryID) error }
RefManager handles references: branches, commits, probably tags in the future it also handles the structure of the commit graph and its traversal (notably, merge-base and log)
type RefModType ¶ added in v0.44.1
type RefModType rune
const ( RefModTypeTilde RefModType = '~' RefModTypeCaret RefModType = '^' RefModTypeAt RefModType = '@' RefModTypeDollar RefModType = '$' )
type RefModifier ¶ added in v0.44.1
type RefModifier struct { Type RefModType Value int }
type ReferenceType ¶
type ReferenceType uint8
ReferenceType represents the type of the reference
const ( ReferenceTypeCommit ReferenceType = iota ReferenceTypeTag ReferenceTypeBranch )
type Repository ¶
type Repository struct { StorageNamespace StorageNamespace `db:"storage_namespace"` CreationDate time.Time `db:"creation_date"` DefaultBranchID BranchID `db:"default_branch"` }
Repository represents repository metadata
type RepositoryID ¶
type RepositoryID string
RepositoryID is an identifier for a repo
func (RepositoryID) String ¶
func (id RepositoryID) String() string
type RepositoryIterator ¶
type RepositoryIterator interface { Next() bool SeekGE(id RepositoryID) Value() *RepositoryRecord Err() error Close() }
type RepositoryRecord ¶
type RepositoryRecord struct { RepositoryID RepositoryID `db:"id"` *Repository }
type ResolvedBranchModifier ¶ added in v0.44.1
type ResolvedBranchModifier int
ResolvedBranchModifier indicates if the ref specified one of the committed/staging modifiers, and which.
const ( ResolvedBranchModifierNone ResolvedBranchModifier = iota ResolvedBranchModifierCommitted ResolvedBranchModifierStaging )
type ResolvedRef ¶ added in v0.44.1
type ResolvedRef struct { Type ReferenceType BranchID BranchID ResolvedBranchModifier ResolvedBranchModifier CommitID CommitID StagingToken StagingToken }
ResolvedRef include resolved information of Ref/RawRef:
Type: Branch / Tag / Commit BranchID: for type ReferenceTypeBranch will hold the branch ID ResolvedBranchModifier: branch indicator if resolved to a branch latest commit, staging or none was specified. CommitID: the commit ID of the branch head, tag or specific hash. StagingToken: empty if ResolvedBranchModifier is ResolvedBranchModifierCommmitted.
type StagedEntry ¶ added in v0.69.0
type StagedEntry struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Identity []byte `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*StagedEntry) Descriptor
deprecated
added in
v0.69.0
func (*StagedEntry) Descriptor() ([]byte, []int)
Deprecated: Use StagedEntry.ProtoReflect.Descriptor instead.
func (*StagedEntry) GetData ¶ added in v0.69.0
func (x *StagedEntry) GetData() []byte
func (*StagedEntry) GetIdentity ¶ added in v0.69.0
func (x *StagedEntry) GetIdentity() []byte
func (*StagedEntry) GetKey ¶ added in v0.69.0
func (x *StagedEntry) GetKey() []byte
func (*StagedEntry) ProtoMessage ¶ added in v0.69.0
func (*StagedEntry) ProtoMessage()
func (*StagedEntry) ProtoReflect ¶ added in v0.69.0
func (x *StagedEntry) ProtoReflect() protoreflect.Message
func (*StagedEntry) Reset ¶ added in v0.69.0
func (x *StagedEntry) Reset()
func (*StagedEntry) String ¶ added in v0.69.0
func (x *StagedEntry) String() string
type StagingManager ¶
type StagingManager interface { // Get returns the value for the provided staging token and key // Returns ErrNotFound if no value found on key. Get(ctx context.Context, st StagingToken, key Key) (*Value, error) // Set writes a (possibly nil) value under the given staging token and key. Set(ctx context.Context, st StagingToken, key Key, value *Value, overwrite bool) error // List returns a ValueIterator for the given staging token List(ctx context.Context, st StagingToken, batchSize int) (ValueIterator, error) // DropKey clears a value by staging token and key DropKey(ctx context.Context, st StagingToken, key Key) error // Drop clears the given staging area Drop(ctx context.Context, st StagingToken) error // DropByPrefix drops all keys starting with the given prefix, from the given staging area DropByPrefix(ctx context.Context, st StagingToken, prefix Key) error }
StagingManager manages entries in a staging area, denoted by a staging token
type StagingToken ¶
type StagingToken string
StagingToken represents a namespace for writes to apply as uncommitted
type StorageNamespace ¶
type StorageNamespace string
StorageNamespace is the URI to the storage location
func (StorageNamespace) String ¶
func (ns StorageNamespace) String() string
type TagData ¶
type TagData struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CommitId string `protobuf:"bytes,2,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` // contains filtered or unexported fields }
func (*TagData) Descriptor
deprecated
func (*TagData) GetCommitId ¶
func (*TagData) ProtoMessage ¶
func (*TagData) ProtoMessage()
func (*TagData) ProtoReflect ¶
func (x *TagData) ProtoReflect() protoreflect.Message
type TagIterator ¶
type ValueIterator ¶
type ValueIterator interface { Next() bool SeekGE(id Key) Value() *ValueRecord Err() error Close() }
type ValueRecord ¶
ValueRecord holds Key with the associated Value information
func (*ValueRecord) IsTombstone ¶
func (v *ValueRecord) IsTombstone() bool
type VersionController ¶
type VersionController interface { // GetRepository returns the Repository metadata object for the given RepositoryID GetRepository(ctx context.Context, repositoryID RepositoryID) (*Repository, error) // CreateRepository stores a new Repository under RepositoryID with the given Branch as default branch CreateRepository(ctx context.Context, repositoryID RepositoryID, storageNamespace StorageNamespace, branchID BranchID) (*Repository, error) // CreateBareRepository stores a new Repository under RepositoryID with no initial branch or commit CreateBareRepository(ctx context.Context, repositoryID RepositoryID, storageNamespace StorageNamespace, defaultBranchID BranchID) (*Repository, error) // ListRepositories returns iterator to scan repositories ListRepositories(ctx context.Context) (RepositoryIterator, error) // DeleteRepository deletes the repository DeleteRepository(ctx context.Context, repositoryID RepositoryID) error // CreateBranch creates branch on repository pointing to ref CreateBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref) (*Branch, error) // UpdateBranch updates branch on repository pointing to ref UpdateBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref) (*Branch, error) // GetBranch gets branch information by branch / repository id GetBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (*Branch, error) // GetTag gets tag's commit id GetTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) (*CommitID, error) // CreateTag creates tag on a repository pointing to a commit id CreateTag(ctx context.Context, repositoryID RepositoryID, tagID TagID, commitID CommitID) error // DeleteTag remove tag from a repository DeleteTag(ctx context.Context, repositoryID RepositoryID, tagID TagID) error // ListTags lists tags on a repository ListTags(ctx context.Context, repositoryID RepositoryID) (TagIterator, error) // Log returns an iterator starting at commit ID up to repository root Log(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (CommitIterator, error) // ListBranches lists branches on repositories ListBranches(ctx context.Context, repositoryID RepositoryID) (BranchIterator, error) // DeleteBranch deletes branch from repository DeleteBranch(ctx context.Context, repositoryID RepositoryID, branchID BranchID) error // Commit the staged data and returns a commit ID that references that change // ErrNothingToCommit in case there is no data in stage Commit(ctx context.Context, repositoryID RepositoryID, branchID BranchID, commitParams CommitParams) (CommitID, error) // WriteMetaRangeByIterator accepts a ValueIterator and writes the entire iterator to a new MetaRange // and returns the result ID. WriteMetaRangeByIterator(ctx context.Context, repositoryID RepositoryID, it ValueIterator) (*MetaRangeID, error) // AddCommitToBranchHead creates a commit in the branch from the given pre-existing tree. // Returns ErrMetaRangeNotFound if the referenced metaRangeID doesn't exist. // Returns ErrCommitNotHeadBranch if the branch is no longer referencing to the parentCommit AddCommitToBranchHead(ctx context.Context, repositoryID RepositoryID, branchID BranchID, commit Commit) (CommitID, error) // AddCommit creates a dangling (no referencing branch) commit in the repo from the pre-existing commit. // Returns ErrMetaRangeNotFound if the referenced metaRangeID doesn't exist. AddCommit(ctx context.Context, repositoryID RepositoryID, commit Commit) (CommitID, error) // GetCommit returns the Commit metadata object for the given CommitID GetCommit(ctx context.Context, repositoryID RepositoryID, commitID CommitID) (*Commit, error) // Dereference returns the resolved ref information based on 'ref' reference Dereference(ctx context.Context, repositoryID RepositoryID, ref Ref) (*ResolvedRef, error) // ParseRef returns parsed 'ref' information as raw reference ParseRef(ref Ref) (RawRef, error) // ResolveRawRef returns the ResolvedRef matching the given RawRef ResolveRawRef(ctx context.Context, repositoryID RepositoryID, rawRef RawRef) (*ResolvedRef, error) // Reset throws all staged data on the repository / branch Reset(ctx context.Context, repositoryID RepositoryID, branchID BranchID) error // ResetKey throws all staged data under the specified key on the repository / branch ResetKey(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error // ResetPrefix throws all staged data starting with the given prefix on the repository / branch ResetPrefix(ctx context.Context, repositoryID RepositoryID, branchID BranchID, key Key) error // Revert creates a reverse patch to the commit given as 'ref', and applies it as a new commit on the given branch. Revert(ctx context.Context, repositoryID RepositoryID, branchID BranchID, ref Ref, parentNumber int, commitParams CommitParams) (CommitID, error) // Merge merges 'source' into 'destination' and returns the commit id for the created merge commit. Merge(ctx context.Context, repositoryID RepositoryID, destination BranchID, source Ref, commitParams CommitParams, strategy string) (CommitID, error) // DiffUncommitted returns iterator to scan the changes made on the branch DiffUncommitted(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (DiffIterator, error) // Diff returns the changes between 'left' and 'right' ref. // This is similar to a two-dot (left..right) diff in git. Diff(ctx context.Context, repositoryID RepositoryID, left, right Ref) (DiffIterator, error) // Compare returns the difference between the commit where 'left' was last synced into 'right', and the most recent commit of `right`. // This is similar to a three-dot (from...to) diff in git. Compare(ctx context.Context, repositoryID RepositoryID, left, right Ref) (DiffIterator, error) // SetHooksHandler set handler for all graveler hooks SetHooksHandler(handler HooksHandler) // GetStagingToken returns the token identifying current staging for branchID of // repositoryID. GetStagingToken(ctx context.Context, repositoryID RepositoryID, branchID BranchID) (*StagingToken, error) GetGarbageCollectionRules(ctx context.Context, repositoryID RepositoryID) (*GarbageCollectionRules, error) SetGarbageCollectionRules(ctx context.Context, repositoryID RepositoryID, rules *GarbageCollectionRules) error // SaveGarbageCollectionCommits saves the sets of active and expired commits, according to the branch rules for garbage collection. // Returns // - run id which can later be used to retrieve the set of commits. // - location where the expired/active commit information was saved // - location where the information of addresses to be removed should be saved // If a previousRunID is specified, commits that were already expired and their ancestors will not be considered as expired/active. // Note: Ancestors of previously expired commits may still be considered if they can be reached from a non-expired commit. SaveGarbageCollectionCommits(ctx context.Context, repositoryID RepositoryID, previousRunID string) (garbageCollectionRunMetadata *GarbageCollectionRunMetadata, err error) // GetBranchProtectionRules return all branch protection rules for the repository GetBranchProtectionRules(ctx context.Context, repositoryID RepositoryID) (*BranchProtectionRules, error) // DeleteBranchProtectionRule deletes the branch protection rule for the given pattern, // or return ErrRuleNotExists if no such rule exists. DeleteBranchProtectionRule(ctx context.Context, repositoryID RepositoryID, pattern string) error // CreateBranchProtectionRule creates a rule for the given name pattern, // or returns ErrRuleAlreadyExists if there is already a rule for the pattern. CreateBranchProtectionRule(ctx context.Context, repositoryID RepositoryID, pattern string, blockedActions []BranchProtectionBlockedAction) error }
type WriteCondition ¶ added in v0.40.3
type WriteCondition struct {
IfAbsent bool
}
type WriteConditionOption ¶ added in v0.40.3
type WriteConditionOption func(condition *WriteCondition)
func IfAbsent ¶ added in v0.40.3
func IfAbsent(v bool) WriteConditionOption