Documentation ¶
Index ¶
- Constants
- Variables
- func BranchPath(branchID BranchID) string
- func CleanupTokensPartition() string
- func CommitExists(ctx context.Context, repository *RepositoryRecord, commitID CommitID, ...) (bool, error)
- func CommitPath(commitID CommitID) string
- func NewRepoInstanceID() string
- func NewRunID() string
- func RepoPartition(repo *RepositoryRecord) string
- func RepoPath(repoID RepositoryID) string
- func RepositoriesPartition() string
- func SettingsPath(key string) string
- func StagingTokenPartition(token StagingToken) string
- func TagPath(tagID TagID) 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
- func (*BranchData) Descriptor() ([]byte, []int)deprecated
- func (x *BranchData) GetCommitId() string
- func (x *BranchData) GetId() string
- func (x *BranchData) GetSealedTokens() []string
- func (x *BranchData) GetStagingToken() string
- func (*BranchData) ProtoMessage()
- func (x *BranchData) ProtoReflect() protoreflect.Message
- func (x *BranchData) Reset()
- func (x *BranchData) String() string
- 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 BranchUpdateFunc
- 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, repository *RepositoryRecord, commit Commit) (CommitID, error)
- func (g *DBGraveler) AddCommitToBranchHead(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ...) (CommitID, error)
- func (g *DBGraveler) Commit(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ...) (CommitID, error)
- func (g *DBGraveler) Compare(ctx context.Context, repository *RepositoryRecord, left, right Ref) (DiffIterator, error)
- func (g *DBGraveler) CreateBareRepository(ctx context.Context, repositoryID RepositoryID, ...) (*RepositoryRecord, error)
- func (g *DBGraveler) CreateBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref) (*Branch, error)
- func (g *DBGraveler) CreateBranchProtectionRule(ctx context.Context, repository *RepositoryRecord, pattern string, ...) error
- func (g *DBGraveler) CreateRepository(ctx context.Context, repositoryID RepositoryID, ...) (*RepositoryRecord, error)
- func (g *DBGraveler) CreateTag(ctx context.Context, repository *RepositoryRecord, tagID TagID, ...) error
- func (g *DBGraveler) Delete(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
- func (g *DBGraveler) DeleteBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID) error
- func (g *DBGraveler) DeleteBranchProtectionRule(ctx context.Context, repository *RepositoryRecord, pattern string) error
- func (g *DBGraveler) DeleteRepository(ctx context.Context, repositoryID RepositoryID) error
- func (g *DBGraveler) DeleteTag(ctx context.Context, repository *RepositoryRecord, tagID TagID) error
- func (g *DBGraveler) Dereference(ctx context.Context, repository *RepositoryRecord, ref Ref) (*ResolvedRef, error)
- func (g *DBGraveler) Diff(ctx context.Context, repository *RepositoryRecord, left, right Ref) (DiffIterator, error)
- func (g *DBGraveler) DiffUncommitted(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (DiffIterator, error)
- func (g *DBGraveler) DumpBranches(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
- func (g *DBGraveler) DumpCommits(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
- func (g *DBGraveler) DumpTags(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
- func (g *DBGraveler) Get(ctx context.Context, repository *RepositoryRecord, ref Ref, key Key) (*Value, error)
- func (g *DBGraveler) GetBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (*Branch, error)
- func (g *DBGraveler) GetBranchProtectionRules(ctx context.Context, repository *RepositoryRecord) (*BranchProtectionRules, error)
- func (g *DBGraveler) GetByCommitID(ctx context.Context, repository *RepositoryRecord, commitID CommitID, key Key) (*Value, error)
- func (g *DBGraveler) GetCommit(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (*Commit, error)
- func (g *DBGraveler) GetGarbageCollectionRules(ctx context.Context, repository *RepositoryRecord) (*GarbageCollectionRules, error)
- func (g *DBGraveler) GetMetaRange(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) (MetaRangeAddress, error)
- func (g *DBGraveler) GetRange(ctx context.Context, repository *RepositoryRecord, rangeID RangeID) (RangeAddress, error)
- func (g *DBGraveler) GetRepository(ctx context.Context, repositoryID RepositoryID) (*RepositoryRecord, error)
- func (g *DBGraveler) GetStagingToken(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (*StagingToken, error)
- func (g *DBGraveler) GetTag(ctx context.Context, repository *RepositoryRecord, tagID TagID) (*CommitID, error)
- func (g *DBGraveler) List(ctx context.Context, repository *RepositoryRecord, ref Ref) (ValueIterator, error)
- func (g *DBGraveler) ListBranches(ctx context.Context, repository *RepositoryRecord) (BranchIterator, error)
- func (g *DBGraveler) ListRepositories(ctx context.Context) (RepositoryIterator, error)
- func (g *DBGraveler) ListTags(ctx context.Context, repository *RepositoryRecord) (TagIterator, error)
- func (g *DBGraveler) LoadBranches(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
- func (g *DBGraveler) LoadCommits(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
- func (g *DBGraveler) LoadTags(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
- func (g *DBGraveler) Log(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (CommitIterator, error)
- func (g *DBGraveler) Merge(ctx context.Context, repository *RepositoryRecord, destination BranchID, ...) (CommitID, error)
- func (g *DBGraveler) ParseRef(ref Ref) (RawRef, error)
- func (g *DBGraveler) Reset(ctx context.Context, repository *RepositoryRecord, branchID BranchID) error
- func (g *DBGraveler) ResetKey(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
- func (g *DBGraveler) ResetPrefix(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
- func (g *DBGraveler) ResolveRawRef(ctx context.Context, repository *RepositoryRecord, rawRef RawRef) (*ResolvedRef, error)
- func (g *DBGraveler) Revert(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref, ...) (CommitID, error)
- func (g *DBGraveler) SaveGarbageCollectionCommits(ctx context.Context, repository *RepositoryRecord, previousRunID string) (*GarbageCollectionRunMetadata, error)
- func (g *DBGraveler) Set(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key, ...) error
- func (g *DBGraveler) SetGarbageCollectionRules(ctx context.Context, repository *RepositoryRecord, ...) error
- func (g *DBGraveler) SetHooksHandler(handler HooksHandler)
- func (g *DBGraveler) UpdateBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref) (*Branch, error)
- func (g *DBGraveler) WriteMetaRange(ctx context.Context, repository *RepositoryRecord, ranges []*RangeInfo) (*MetaRangeInfo, error)
- func (g *DBGraveler) WriteMetaRangeByIterator(ctx context.Context, repository *RepositoryRecord, it ValueIterator) (*MetaRangeID, error)
- func (g *DBGraveler) WriteRange(ctx context.Context, repository *RepositoryRecord, it ValueIterator) (*RangeInfo, error)
- type Diff
- type DiffIterator
- type DiffSummary
- type DiffType
- type Dumper
- type EventType
- type FilterTombstoneIterator
- 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, repository *RepositoryRecord, commit Commit) (CommitID, error)
- func (g *KVGraveler) AddCommitToBranchHead(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ...) (CommitID, error)
- func (g *KVGraveler) Commit(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ...) (CommitID, error)
- func (g *KVGraveler) Compare(ctx context.Context, repository *RepositoryRecord, left, right Ref) (DiffIterator, error)
- func (g *KVGraveler) CreateBareRepository(ctx context.Context, repositoryID RepositoryID, ...) (*RepositoryRecord, error)
- func (g *KVGraveler) CreateBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref) (*Branch, error)
- func (g *KVGraveler) CreateBranchProtectionRule(ctx context.Context, repository *RepositoryRecord, pattern string, ...) error
- func (g *KVGraveler) CreateRepository(ctx context.Context, repositoryID RepositoryID, ...) (*RepositoryRecord, error)
- func (g *KVGraveler) CreateTag(ctx context.Context, repository *RepositoryRecord, tagID TagID, ...) error
- func (g *KVGraveler) Delete(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
- func (g *KVGraveler) DeleteBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID) error
- func (g *KVGraveler) DeleteBranchProtectionRule(ctx context.Context, repository *RepositoryRecord, pattern string) error
- func (g *KVGraveler) DeleteRepository(ctx context.Context, repositoryID RepositoryID) error
- func (g *KVGraveler) DeleteTag(ctx context.Context, repository *RepositoryRecord, tagID TagID) error
- func (g *KVGraveler) Dereference(ctx context.Context, repository *RepositoryRecord, ref Ref) (*ResolvedRef, error)
- func (g *KVGraveler) Diff(ctx context.Context, repository *RepositoryRecord, left, right Ref) (DiffIterator, error)
- func (g *KVGraveler) DiffUncommitted(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (DiffIterator, error)
- func (g *KVGraveler) DumpBranches(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
- func (g *KVGraveler) DumpCommits(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
- func (g *KVGraveler) DumpTags(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
- func (g *KVGraveler) Get(ctx context.Context, repository *RepositoryRecord, ref Ref, key Key) (*Value, error)
- func (g *KVGraveler) GetBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (*Branch, error)
- func (g *KVGraveler) GetBranchProtectionRules(ctx context.Context, repository *RepositoryRecord) (*BranchProtectionRules, error)
- func (g *KVGraveler) GetByCommitID(ctx context.Context, repository *RepositoryRecord, commitID CommitID, key Key) (*Value, error)
- func (g *KVGraveler) GetCommit(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (*Commit, error)
- func (g *KVGraveler) GetGarbageCollectionRules(ctx context.Context, repository *RepositoryRecord) (*GarbageCollectionRules, error)
- func (g *KVGraveler) GetMetaRange(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) (MetaRangeAddress, error)
- func (g *KVGraveler) GetRange(ctx context.Context, repository *RepositoryRecord, rangeID RangeID) (RangeAddress, error)
- func (g *KVGraveler) GetRepository(ctx context.Context, repositoryID RepositoryID) (*RepositoryRecord, error)
- func (g *KVGraveler) GetStagingToken(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (*StagingToken, error)
- func (g *KVGraveler) GetTag(ctx context.Context, repository *RepositoryRecord, tagID TagID) (*CommitID, error)
- func (g *KVGraveler) List(ctx context.Context, repository *RepositoryRecord, ref Ref) (ValueIterator, error)
- func (g *KVGraveler) ListBranches(ctx context.Context, repository *RepositoryRecord) (BranchIterator, error)
- func (g *KVGraveler) ListRepositories(ctx context.Context) (RepositoryIterator, error)
- func (g *KVGraveler) ListTags(ctx context.Context, repository *RepositoryRecord) (TagIterator, error)
- func (g *KVGraveler) LoadBranches(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
- func (g *KVGraveler) LoadCommits(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
- func (g *KVGraveler) LoadTags(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
- func (g *KVGraveler) Log(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (CommitIterator, error)
- func (g *KVGraveler) Merge(ctx context.Context, repository *RepositoryRecord, destination BranchID, ...) (CommitID, error)
- func (g *KVGraveler) ParseRef(ref Ref) (RawRef, error)
- func (g *KVGraveler) Reset(ctx context.Context, repository *RepositoryRecord, branchID BranchID) error
- func (g *KVGraveler) ResetKey(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
- func (g *KVGraveler) ResetPrefix(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
- func (g *KVGraveler) ResolveRawRef(ctx context.Context, repository *RepositoryRecord, rawRef RawRef) (*ResolvedRef, error)
- func (g *KVGraveler) Revert(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref, ...) (CommitID, error)
- func (g *KVGraveler) SaveGarbageCollectionCommits(ctx context.Context, repository *RepositoryRecord, previousRunID string) (*GarbageCollectionRunMetadata, error)
- func (g *KVGraveler) Set(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key, ...) error
- func (g *KVGraveler) SetGarbageCollectionRules(ctx context.Context, repository *RepositoryRecord, ...) error
- func (g *KVGraveler) SetHooksHandler(handler HooksHandler)
- func (g *KVGraveler) UpdateBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref) (*Branch, error)
- func (g *KVGraveler) WriteMetaRange(ctx context.Context, repository *RepositoryRecord, ranges []*RangeInfo) (*MetaRangeInfo, error)
- func (g *KVGraveler) WriteMetaRangeByIterator(ctx context.Context, repository *RepositoryRecord, it ValueIterator) (*MetaRangeID, error)
- func (g *KVGraveler) WriteRange(ctx context.Context, repository *RepositoryRecord, 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 RepositoryData
- func (*RepositoryData) Descriptor() ([]byte, []int)deprecated
- func (x *RepositoryData) GetCreationDate() *timestamppb.Timestamp
- func (x *RepositoryData) GetDefaultBranchId() string
- func (x *RepositoryData) GetId() string
- func (x *RepositoryData) GetInstanceUid() string
- func (x *RepositoryData) GetState() RepositoryState
- func (x *RepositoryData) GetStorageNamespace() string
- func (*RepositoryData) ProtoMessage()
- func (x *RepositoryData) ProtoReflect() protoreflect.Message
- func (x *RepositoryData) Reset()
- func (x *RepositoryData) String() string
- type RepositoryID
- type RepositoryIterator
- type RepositoryRecord
- type RepositoryState
- func (RepositoryState) Descriptor() protoreflect.EnumDescriptor
- func (x RepositoryState) Enum() *RepositoryState
- func (RepositoryState) EnumDescriptor() ([]byte, []int)deprecated
- func (x RepositoryState) Number() protoreflect.EnumNumber
- func (x RepositoryState) String() string
- func (RepositoryState) Type() protoreflect.EnumType
- type ResolvedBranchModifier
- type ResolvedRef
- type StagedEntryData
- func (*StagedEntryData) Descriptor() ([]byte, []int)deprecated
- func (x *StagedEntryData) GetData() []byte
- func (x *StagedEntryData) GetIdentity() []byte
- func (x *StagedEntryData) GetKey() []byte
- func (*StagedEntryData) ProtoMessage()
- func (x *StagedEntryData) ProtoReflect() protoreflect.Message
- func (x *StagedEntryData) Reset()
- func (x *StagedEntryData) String() string
- type StagingManager
- type StagingToken
- type StorageNamespace
- type TagData
- type TagID
- type TagIterator
- type TagRecord
- type Value
- type ValueIterator
- type ValueRecord
- type ValueUpdateFunc
- type VersionController
- type WriteCondition
- type WriteConditionOption
Constants ¶
const ( ListingDefaultBatchSize = 1000 ListingMaxBatchSize = 100000 MergeStrategySrcWins = "source-wins" MergeStrategyDestWins = "dest-wins" SettingsRelativeKey = "%s/settings/%s.json" // where the settings are saved relative to the storage namespace BrnachUpdateMaxInterval = 5 * time.Second BranchUpdateMaxTries = 10 )
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") ErrReadingFromStore = errors.New("cannot read from store") 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) ErrNoCommitGeneration = errors.New("no commit generation") 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) ErrRepositoryInDeletion = errors.New("repository in deletion") 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") ErrTooManyTries = errors.New("too many tries") )
var ( RepositoryState_name = map[int32]string{ 0: "ACTIVE", 1: "IN_DELETION", } RepositoryState_value = map[string]int32{ "ACTIVE": 0, "IN_DELETION": 1, } )
Enum value maps for RepositoryState.
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 BranchPath ¶ added in v0.70.0
func CleanupTokensPartition ¶ added in v0.70.1
func CleanupTokensPartition() string
func CommitExists ¶ added in v0.70.0
func CommitExists(ctx context.Context, repository *RepositoryRecord, commitID CommitID, manager RefManager) (bool, error)
func CommitPath ¶ added in v0.70.0
func NewRepoInstanceID ¶ added in v0.70.0
func NewRepoInstanceID() string
NewRepoInstanceID Returns a new unique identifier for the repository instance
func RepoPartition ¶ added in v0.70.0
func RepoPartition(repo *RepositoryRecord) string
RepoPartition - The partition under which all the repository's entities (branched, commits, tags) The Repository object itself is found under the common RepositoriesPartition, as it is needed to generate this partition
func RepoPath ¶ added in v0.70.0
func RepoPath(repoID RepositoryID) string
func RepositoriesPartition ¶ added in v0.70.0
func RepositoriesPartition() string
RepositoriesPartition - The common partition under which all repositories exist
func SettingsPath ¶ added in v0.70.1
func StagingTokenPartition ¶ added in v0.70.0
func StagingTokenPartition(token StagingToken) string
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 // SealedTokens - Staging tokens are appended to the front, this allows building the diff iterator easily SealedTokens []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"` StagingToken string `protobuf:"bytes,3,opt,name=staging_token,json=stagingToken,proto3" json:"staging_token,omitempty"` SealedTokens []string `protobuf:"bytes,4,rep,name=sealed_tokens,json=sealedTokens,proto3" json:"sealed_tokens,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) GetSealedTokens ¶ added in v0.70.0
func (x *BranchData) GetSealedTokens() []string
func (*BranchData) GetStagingToken ¶ added in v0.70.0
func (x *BranchData) GetStagingToken() 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, repository *RepositoryRecord, branchID BranchID, lockedFn BranchLockerFunc) (interface{}, error) MetadataUpdater(ctx context.Context, repository *RepositoryRecord, 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 BranchUpdateFunc ¶ added in v0.70.0
BranchUpdateFunc Used to pass validation call back to ref manager for UpdateBranch flow
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. CombinedIterator can be constructed from other CombinedIterator to allow chaining of multiple ValueIterators.
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)
func CommitFromProto ¶ added in v0.70.0
func CommitFromProto(pb *CommitData) *Commit
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 ProtoFromCommit ¶ added in v0.70.0
func ProtoFromCommit(commitID CommitID, c *Commit) *CommitData
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, repository *RepositoryRecord, commit Commit) (CommitID, error)
func (*DBGraveler) AddCommitToBranchHead ¶ added in v0.69.0
func (g *DBGraveler) AddCommitToBranchHead(ctx context.Context, repository *RepositoryRecord, branchID BranchID, commit Commit) (CommitID, error)
func (*DBGraveler) Commit ¶ added in v0.69.0
func (g *DBGraveler) Commit(ctx context.Context, repository *RepositoryRecord, branchID BranchID, params CommitParams) (CommitID, error)
func (*DBGraveler) Compare ¶ added in v0.69.0
func (g *DBGraveler) Compare(ctx context.Context, repository *RepositoryRecord, 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) (*RepositoryRecord, error)
func (*DBGraveler) CreateBranch ¶ added in v0.69.0
func (g *DBGraveler) CreateBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref) (*Branch, error)
func (*DBGraveler) CreateBranchProtectionRule ¶ added in v0.69.0
func (g *DBGraveler) CreateBranchProtectionRule(ctx context.Context, repository *RepositoryRecord, 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) (*RepositoryRecord, error)
func (*DBGraveler) CreateTag ¶ added in v0.69.0
func (g *DBGraveler) CreateTag(ctx context.Context, repository *RepositoryRecord, tagID TagID, commitID CommitID) error
func (*DBGraveler) Delete ¶ added in v0.69.0
func (g *DBGraveler) Delete(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
func (*DBGraveler) DeleteBranch ¶ added in v0.69.0
func (g *DBGraveler) DeleteBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID) error
func (*DBGraveler) DeleteBranchProtectionRule ¶ added in v0.69.0
func (g *DBGraveler) DeleteBranchProtectionRule(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, tagID TagID) error
func (*DBGraveler) Dereference ¶ added in v0.69.0
func (g *DBGraveler) Dereference(ctx context.Context, repository *RepositoryRecord, ref Ref) (*ResolvedRef, error)
func (*DBGraveler) Diff ¶ added in v0.69.0
func (g *DBGraveler) Diff(ctx context.Context, repository *RepositoryRecord, left, right Ref) (DiffIterator, error)
func (*DBGraveler) DiffUncommitted ¶ added in v0.69.0
func (g *DBGraveler) DiffUncommitted(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (DiffIterator, error)
func (*DBGraveler) DumpBranches ¶ added in v0.69.0
func (g *DBGraveler) DumpBranches(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
func (*DBGraveler) DumpCommits ¶ added in v0.69.0
func (g *DBGraveler) DumpCommits(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
func (*DBGraveler) DumpTags ¶ added in v0.69.0
func (g *DBGraveler) DumpTags(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
func (*DBGraveler) Get ¶ added in v0.69.0
func (g *DBGraveler) Get(ctx context.Context, repository *RepositoryRecord, ref Ref, key Key) (*Value, error)
func (*DBGraveler) GetBranch ¶ added in v0.69.0
func (g *DBGraveler) GetBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (*Branch, error)
func (*DBGraveler) GetBranchProtectionRules ¶ added in v0.69.0
func (g *DBGraveler) GetBranchProtectionRules(ctx context.Context, repository *RepositoryRecord) (*BranchProtectionRules, error)
func (*DBGraveler) GetByCommitID ¶ added in v0.70.3
func (g *DBGraveler) GetByCommitID(ctx context.Context, repository *RepositoryRecord, commitID CommitID, key Key) (*Value, error)
func (*DBGraveler) GetCommit ¶ added in v0.69.0
func (g *DBGraveler) GetCommit(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (*Commit, error)
func (*DBGraveler) GetGarbageCollectionRules ¶ added in v0.69.0
func (g *DBGraveler) GetGarbageCollectionRules(ctx context.Context, repository *RepositoryRecord) (*GarbageCollectionRules, error)
func (*DBGraveler) GetMetaRange ¶ added in v0.69.0
func (g *DBGraveler) GetMetaRange(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) (MetaRangeAddress, error)
func (*DBGraveler) GetRange ¶ added in v0.69.0
func (g *DBGraveler) GetRange(ctx context.Context, repository *RepositoryRecord, rangeID RangeID) (RangeAddress, error)
func (*DBGraveler) GetRepository ¶ added in v0.69.0
func (g *DBGraveler) GetRepository(ctx context.Context, repositoryID RepositoryID) (*RepositoryRecord, error)
func (*DBGraveler) GetStagingToken ¶ added in v0.69.0
func (g *DBGraveler) GetStagingToken(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (*StagingToken, error)
func (*DBGraveler) GetTag ¶ added in v0.69.0
func (g *DBGraveler) GetTag(ctx context.Context, repository *RepositoryRecord, tagID TagID) (*CommitID, error)
func (*DBGraveler) List ¶ added in v0.69.0
func (g *DBGraveler) List(ctx context.Context, repository *RepositoryRecord, ref Ref) (ValueIterator, error)
func (*DBGraveler) ListBranches ¶ added in v0.69.0
func (g *DBGraveler) ListBranches(ctx context.Context, repository *RepositoryRecord) (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, repository *RepositoryRecord) (TagIterator, error)
func (*DBGraveler) LoadBranches ¶ added in v0.69.0
func (g *DBGraveler) LoadBranches(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
func (*DBGraveler) LoadCommits ¶ added in v0.69.0
func (g *DBGraveler) LoadCommits(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
func (*DBGraveler) LoadTags ¶ added in v0.69.0
func (g *DBGraveler) LoadTags(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
func (*DBGraveler) Log ¶ added in v0.69.0
func (g *DBGraveler) Log(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (CommitIterator, error)
func (*DBGraveler) Merge ¶ added in v0.69.0
func (g *DBGraveler) Merge(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, branchID BranchID) error
func (*DBGraveler) ResetKey ¶ added in v0.69.0
func (g *DBGraveler) ResetKey(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
func (*DBGraveler) ResetPrefix ¶ added in v0.69.0
func (g *DBGraveler) ResetPrefix(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
func (*DBGraveler) ResolveRawRef ¶ added in v0.69.0
func (g *DBGraveler) ResolveRawRef(ctx context.Context, repository *RepositoryRecord, rawRef RawRef) (*ResolvedRef, error)
func (*DBGraveler) Revert ¶ added in v0.69.0
func (g *DBGraveler) Revert(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, previousRunID string) (*GarbageCollectionRunMetadata, error)
func (*DBGraveler) Set ¶ added in v0.69.0
func (g *DBGraveler) Set(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key, value Value, writeConditions ...WriteConditionOption) error
func (*DBGraveler) SetGarbageCollectionRules ¶ added in v0.69.0
func (g *DBGraveler) SetGarbageCollectionRules(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, branchID BranchID, ref Ref) (*Branch, error)
func (*DBGraveler) WriteMetaRange ¶ added in v0.69.0
func (g *DBGraveler) WriteMetaRange(ctx context.Context, repository *RepositoryRecord, ranges []*RangeInfo) (*MetaRangeInfo, error)
func (*DBGraveler) WriteMetaRangeByIterator ¶ added in v0.69.0
func (g *DBGraveler) WriteMetaRangeByIterator(ctx context.Context, repository *RepositoryRecord, it ValueIterator) (*MetaRangeID, error)
func (*DBGraveler) WriteRange ¶ added in v0.69.0
func (g *DBGraveler) WriteRange(ctx context.Context, repository *RepositoryRecord, 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) 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, repository *RepositoryRecord) (*MetaRangeID, error) // DumpBranches iterates through all branches and dumps them in Graveler format DumpBranches(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error) // DumpTags iterates through all tags and dumps them in Graveler format DumpTags(ctx context.Context, repository *RepositoryRecord) (*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 FilterTombstoneIterator ¶ added in v0.70.0
type FilterTombstoneIterator struct {
// contains filtered or unexported fields
}
FilterTombstoneIterator wraps a value iterator and filters out tombstones.
func NewFilterTombstoneIterator ¶ added in v0.70.0
func NewFilterTombstoneIterator(iter ValueIterator) *FilterTombstoneIterator
func (*FilterTombstoneIterator) Close ¶ added in v0.70.0
func (f *FilterTombstoneIterator) Close()
func (*FilterTombstoneIterator) Err ¶ added in v0.70.0
func (f *FilterTombstoneIterator) Err() error
func (*FilterTombstoneIterator) Next ¶ added in v0.70.0
func (f *FilterTombstoneIterator) Next() bool
func (*FilterTombstoneIterator) SeekGE ¶ added in v0.70.0
func (f *FilterTombstoneIterator) SeekGE(id Key)
func (*FilterTombstoneIterator) Value ¶ added in v0.70.0
func (f *FilterTombstoneIterator) Value() *ValueRecord
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, repository *RepositoryRecord, 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 { CommittedManager CommittedManager RefManager RefManager StagingManager StagingManager // contains filtered or unexported fields }
func NewKVGraveler ¶ added in v0.69.0
func NewKVGraveler(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, repository *RepositoryRecord, commit Commit) (CommitID, error)
func (*KVGraveler) AddCommitToBranchHead ¶ added in v0.69.0
func (g *KVGraveler) AddCommitToBranchHead(ctx context.Context, repository *RepositoryRecord, branchID BranchID, commit Commit) (CommitID, error)
func (*KVGraveler) Commit ¶ added in v0.69.0
func (g *KVGraveler) Commit(ctx context.Context, repository *RepositoryRecord, branchID BranchID, params CommitParams) (CommitID, error)
func (*KVGraveler) Compare ¶ added in v0.69.0
func (g *KVGraveler) Compare(ctx context.Context, repository *RepositoryRecord, 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) (*RepositoryRecord, error)
func (*KVGraveler) CreateBranch ¶ added in v0.69.0
func (g *KVGraveler) CreateBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref) (*Branch, error)
func (*KVGraveler) CreateBranchProtectionRule ¶ added in v0.69.0
func (g *KVGraveler) CreateBranchProtectionRule(ctx context.Context, repository *RepositoryRecord, 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) (*RepositoryRecord, error)
func (*KVGraveler) CreateTag ¶ added in v0.69.0
func (g *KVGraveler) CreateTag(ctx context.Context, repository *RepositoryRecord, tagID TagID, commitID CommitID) error
func (*KVGraveler) Delete ¶ added in v0.69.0
func (g *KVGraveler) Delete(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
func (*KVGraveler) DeleteBranch ¶ added in v0.69.0
func (g *KVGraveler) DeleteBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID) error
func (*KVGraveler) DeleteBranchProtectionRule ¶ added in v0.69.0
func (g *KVGraveler) DeleteBranchProtectionRule(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, tagID TagID) error
func (*KVGraveler) Dereference ¶ added in v0.69.0
func (g *KVGraveler) Dereference(ctx context.Context, repository *RepositoryRecord, ref Ref) (*ResolvedRef, error)
func (*KVGraveler) Diff ¶ added in v0.69.0
func (g *KVGraveler) Diff(ctx context.Context, repository *RepositoryRecord, left, right Ref) (DiffIterator, error)
func (*KVGraveler) DiffUncommitted ¶ added in v0.69.0
func (g *KVGraveler) DiffUncommitted(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (DiffIterator, error)
DiffUncommitted returns DiffIterator between committed data and staging area of a branch
func (*KVGraveler) DumpBranches ¶ added in v0.69.0
func (g *KVGraveler) DumpBranches(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
func (*KVGraveler) DumpCommits ¶ added in v0.69.0
func (g *KVGraveler) DumpCommits(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
func (*KVGraveler) DumpTags ¶ added in v0.69.0
func (g *KVGraveler) DumpTags(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error)
func (*KVGraveler) Get ¶ added in v0.69.0
func (g *KVGraveler) Get(ctx context.Context, repository *RepositoryRecord, ref Ref, key Key) (*Value, error)
func (*KVGraveler) GetBranch ¶ added in v0.69.0
func (g *KVGraveler) GetBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (*Branch, error)
func (*KVGraveler) GetBranchProtectionRules ¶ added in v0.69.0
func (g *KVGraveler) GetBranchProtectionRules(ctx context.Context, repository *RepositoryRecord) (*BranchProtectionRules, error)
func (*KVGraveler) GetByCommitID ¶ added in v0.70.3
func (g *KVGraveler) GetByCommitID(ctx context.Context, repository *RepositoryRecord, commitID CommitID, key Key) (*Value, error)
func (*KVGraveler) GetCommit ¶ added in v0.69.0
func (g *KVGraveler) GetCommit(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (*Commit, error)
func (*KVGraveler) GetGarbageCollectionRules ¶ added in v0.69.0
func (g *KVGraveler) GetGarbageCollectionRules(ctx context.Context, repository *RepositoryRecord) (*GarbageCollectionRules, error)
func (*KVGraveler) GetMetaRange ¶ added in v0.69.0
func (g *KVGraveler) GetMetaRange(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) (MetaRangeAddress, error)
func (*KVGraveler) GetRange ¶ added in v0.69.0
func (g *KVGraveler) GetRange(ctx context.Context, repository *RepositoryRecord, rangeID RangeID) (RangeAddress, error)
func (*KVGraveler) GetRepository ¶ added in v0.69.0
func (g *KVGraveler) GetRepository(ctx context.Context, repositoryID RepositoryID) (*RepositoryRecord, error)
func (*KVGraveler) GetStagingToken ¶ added in v0.69.0
func (g *KVGraveler) GetStagingToken(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (*StagingToken, error)
func (*KVGraveler) GetTag ¶ added in v0.69.0
func (g *KVGraveler) GetTag(ctx context.Context, repository *RepositoryRecord, tagID TagID) (*CommitID, error)
func (*KVGraveler) List ¶ added in v0.69.0
func (g *KVGraveler) List(ctx context.Context, repository *RepositoryRecord, ref Ref) (ValueIterator, error)
func (*KVGraveler) ListBranches ¶ added in v0.69.0
func (g *KVGraveler) ListBranches(ctx context.Context, repository *RepositoryRecord) (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, repository *RepositoryRecord) (TagIterator, error)
func (*KVGraveler) LoadBranches ¶ added in v0.69.0
func (g *KVGraveler) LoadBranches(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
func (*KVGraveler) LoadCommits ¶ added in v0.69.0
func (g *KVGraveler) LoadCommits(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
func (*KVGraveler) LoadTags ¶ added in v0.69.0
func (g *KVGraveler) LoadTags(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error
func (*KVGraveler) Log ¶ added in v0.69.0
func (g *KVGraveler) Log(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (CommitIterator, error)
func (*KVGraveler) Merge ¶ added in v0.69.0
func (g *KVGraveler) Merge(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, branchID BranchID) error
func (*KVGraveler) ResetKey ¶ added in v0.69.0
func (g *KVGraveler) ResetKey(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
func (*KVGraveler) ResetPrefix ¶ added in v0.69.0
func (g *KVGraveler) ResetPrefix(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error
func (*KVGraveler) ResolveRawRef ¶ added in v0.69.0
func (g *KVGraveler) ResolveRawRef(ctx context.Context, repository *RepositoryRecord, rawRef RawRef) (*ResolvedRef, error)
func (*KVGraveler) Revert ¶ added in v0.69.0
func (g *KVGraveler) Revert(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, previousRunID string) (*GarbageCollectionRunMetadata, error)
func (*KVGraveler) Set ¶ added in v0.69.0
func (g *KVGraveler) Set(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key, value Value, writeConditions ...WriteConditionOption) error
func (*KVGraveler) SetGarbageCollectionRules ¶ added in v0.69.0
func (g *KVGraveler) SetGarbageCollectionRules(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, branchID BranchID, ref Ref) (*Branch, error)
func (*KVGraveler) WriteMetaRange ¶ added in v0.69.0
func (g *KVGraveler) WriteMetaRange(ctx context.Context, repository *RepositoryRecord, ranges []*RangeInfo) (*MetaRangeInfo, error)
func (*KVGraveler) WriteMetaRangeByIterator ¶ added in v0.69.0
func (g *KVGraveler) WriteMetaRangeByIterator(ctx context.Context, repository *RepositoryRecord, it ValueIterator) (*MetaRangeID, error)
func (*KVGraveler) WriteRange ¶ added in v0.69.0
func (g *KVGraveler) WriteRange(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, ref Ref, key Key) (*Value, error) // GetByCommitID returns value from repository / commit by key and error if value does not exist GetByCommitID(ctx context.Context, repository *RepositoryRecord, commitID CommitID, key Key) (*Value, error) // Set stores value on repository / branch by key. nil value is a valid value for tombstone Set(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key, value Value, writeConditions ...WriteConditionOption) error // Delete value from repository / branch by key Delete(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error // List lists values on repository / ref List(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, metaRangeID MetaRangeID) error // LoadBranches iterates through all branches in Graveler format and loads them into repositoryID LoadBranches(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) error // LoadTags iterates through all tags in Graveler format and loads them into repositoryID LoadTags(ctx context.Context, repository *RepositoryRecord, 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
func (MetaRangeID) String ¶ added in v0.70.0
func (id MetaRangeID) String() string
type MetaRangeInfo ¶
type MetaRangeInfo struct { // ID is the identifier for the written MetaRange. // Calculated by a 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, repository *RepositoryRecord, metaRangeID MetaRangeID) (MetaRangeAddress, error) // GetRange returns information where rangeID is stored. GetRange(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, it ValueIterator) (*RangeInfo, error) // WriteMetaRange creates a new MetaRange from the given Ranges. WriteMetaRange(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, 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, repository *RepositoryRecord, 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, repository *RepositoryRecord, branchNamePattern string) ([]BranchProtectionBlockedAction, error) // GetRules returns all branch protection rules for the repository GetRules(ctx context.Context, repository *RepositoryRecord) (*BranchProtectionRules, error) // IsBlocked returns whether the action is blocked by any branch protection rule matching the given branch. IsBlocked(ctx context.Context, repository *RepositoryRecord, 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) (*RepositoryRecord, error) // CreateRepository stores a new Repository under RepositoryID with the given Branch as default branch CreateRepository(ctx context.Context, repositoryID RepositoryID, repository Repository) (*RepositoryRecord, error) // CreateBareRepository stores a new repository under RepositoryID without creating an initial commit and branch CreateBareRepository(ctx context.Context, repositoryID RepositoryID, repository Repository) (*RepositoryRecord, 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, repository *RepositoryRecord, rawRef RawRef) (*ResolvedRef, error) // GetBranch returns the Branch metadata object for the given BranchID GetBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (*Branch, error) // CreateBranch creates a branch with the given id and Branch metadata CreateBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID, branch Branch) error // SetBranch points the given BranchID at the given Branch metadata SetBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID, branch Branch) error // BranchUpdate Conditional set of branch with validation callback BranchUpdate(ctx context.Context, repository *RepositoryRecord, branchID BranchID, f BranchUpdateFunc) error // DeleteBranch deletes the branch DeleteBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID) error // ListBranches lists branches ListBranches(ctx context.Context, repository *RepositoryRecord) (BranchIterator, error) // GCBranchIterator TODO (niro): Remove when DB implementation is deleted // GCBranchIterator temporary WA to support both DB and KV GC BranchIterator, which iterates over branches by order of commit ID GCBranchIterator(ctx context.Context, repository *RepositoryRecord) (BranchIterator, error) // GetTag returns the Tag metadata object for the given TagID GetTag(ctx context.Context, repository *RepositoryRecord, tagID TagID) (*CommitID, error) // CreateTag create a given tag pointing to a commit CreateTag(ctx context.Context, repository *RepositoryRecord, tagID TagID, commitID CommitID) error // DeleteTag deletes the tag DeleteTag(ctx context.Context, repository *RepositoryRecord, tagID TagID) error // ListTags lists tags ListTags(ctx context.Context, repository *RepositoryRecord) (TagIterator, error) // GetCommit returns the Commit metadata object for the given CommitID. GetCommit(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (*Commit, error) // GetCommitByPrefix returns the Commit metadata object for the given prefix CommitID. // if more than 1 commit starts with the ID prefix returns error GetCommitByPrefix(ctx context.Context, repository *RepositoryRecord, prefix CommitID) (*Commit, error) // AddCommit stores the Commit object, returning its ID AddCommit(ctx context.Context, repository *RepositoryRecord, commit Commit) (CommitID, error) // RemoveCommit deletes commit from store - used for repository cleanup RemoveCommit(ctx context.Context, repository *RepositoryRecord, commitID 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, repository *RepositoryRecord, commitIDs ...CommitID) (*Commit, error) // Log returns an iterator starting at commit ID up to repository root Log(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (CommitIterator, error) // ListCommits returns an iterator over all known commits, ordered by their commit ID ListCommits(ctx context.Context, repository *RepositoryRecord) (CommitIterator, error) // GCCommitIterator TODO (niro): Remove when DB implementation is deleted // GCCommitIterator temporary WA to support both DB and KV GC CommitIterator GCCommitIterator(ctx context.Context, repository *RepositoryRecord) (CommitIterator, 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"` // RepositoryState represents the state of the repository, only ACTIVE repository is considered a valid one. // other states represent in invalid temporary or terminal state State RepositoryState // InstanceUID identifies repository in a unique way. Since repositories with same name can be deleted and recreated // this field identifies the specific instance, and used in the KV store key path to store all the entities belonging // to this specific instantiation of repo with the given ID InstanceUID string }
Repository represents repository metadata
func NewRepository ¶ added in v0.70.0
func NewRepository(storageNamespace StorageNamespace, defaultBranchID BranchID) Repository
type RepositoryData ¶ added in v0.70.0
type RepositoryData struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` StorageNamespace string `protobuf:"bytes,2,opt,name=storage_namespace,json=storageNamespace,proto3" json:"storage_namespace,omitempty"` DefaultBranchId string `protobuf:"bytes,3,opt,name=default_branch_id,json=defaultBranchId,proto3" json:"default_branch_id,omitempty"` CreationDate *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=creation_date,json=creationDate,proto3" json:"creation_date,omitempty"` State RepositoryState `protobuf:"varint,5,opt,name=state,proto3,enum=io.treeverse.lakefs.graveler.RepositoryState" json:"state,omitempty"` InstanceUid string `protobuf:"bytes,6,opt,name=instance_uid,json=instanceUid,proto3" json:"instance_uid,omitempty"` // contains filtered or unexported fields }
func ProtoFromRepo ¶ added in v0.70.0
func ProtoFromRepo(repo *RepositoryRecord) *RepositoryData
func (*RepositoryData) Descriptor
deprecated
added in
v0.70.0
func (*RepositoryData) Descriptor() ([]byte, []int)
Deprecated: Use RepositoryData.ProtoReflect.Descriptor instead.
func (*RepositoryData) GetCreationDate ¶ added in v0.70.0
func (x *RepositoryData) GetCreationDate() *timestamppb.Timestamp
func (*RepositoryData) GetDefaultBranchId ¶ added in v0.70.0
func (x *RepositoryData) GetDefaultBranchId() string
func (*RepositoryData) GetId ¶ added in v0.70.0
func (x *RepositoryData) GetId() string
func (*RepositoryData) GetInstanceUid ¶ added in v0.70.0
func (x *RepositoryData) GetInstanceUid() string
func (*RepositoryData) GetState ¶ added in v0.70.0
func (x *RepositoryData) GetState() RepositoryState
func (*RepositoryData) GetStorageNamespace ¶ added in v0.70.0
func (x *RepositoryData) GetStorageNamespace() string
func (*RepositoryData) ProtoMessage ¶ added in v0.70.0
func (*RepositoryData) ProtoMessage()
func (*RepositoryData) ProtoReflect ¶ added in v0.70.0
func (x *RepositoryData) ProtoReflect() protoreflect.Message
func (*RepositoryData) Reset ¶ added in v0.70.0
func (x *RepositoryData) Reset()
func (*RepositoryData) String ¶ added in v0.70.0
func (x *RepositoryData) String() string
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 }
func RepoFromProto ¶ added in v0.70.0
func RepoFromProto(pb *RepositoryData) *RepositoryRecord
type RepositoryState ¶ added in v0.70.0
type RepositoryState int32
const ( RepositoryState_ACTIVE RepositoryState = 0 RepositoryState_IN_DELETION RepositoryState = 1 )
func (RepositoryState) Descriptor ¶ added in v0.70.0
func (RepositoryState) Descriptor() protoreflect.EnumDescriptor
func (RepositoryState) Enum ¶ added in v0.70.0
func (x RepositoryState) Enum() *RepositoryState
func (RepositoryState) EnumDescriptor
deprecated
added in
v0.70.0
func (RepositoryState) EnumDescriptor() ([]byte, []int)
Deprecated: Use RepositoryState.Descriptor instead.
func (RepositoryState) Number ¶ added in v0.70.0
func (x RepositoryState) Number() protoreflect.EnumNumber
func (RepositoryState) String ¶ added in v0.70.0
func (x RepositoryState) String() string
func (RepositoryState) Type ¶ added in v0.70.0
func (RepositoryState) Type() protoreflect.EnumType
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 ResolvedBranchModifier ResolvedBranchModifier BranchRecord }
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 the latest commit, staging or none was specified. CommitID: the commit ID of the branch head, tag or specific hash. StagingToken: empty if ResolvedBranchModifier is ResolvedBranchModifierCommitted.
type StagedEntryData ¶ added in v0.70.0
type StagedEntryData 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 ProtoFromStagedEntry ¶ added in v0.70.0
func ProtoFromStagedEntry(key []byte, v *Value) *StagedEntryData
func (*StagedEntryData) Descriptor
deprecated
added in
v0.70.0
func (*StagedEntryData) Descriptor() ([]byte, []int)
Deprecated: Use StagedEntryData.ProtoReflect.Descriptor instead.
func (*StagedEntryData) GetData ¶ added in v0.70.0
func (x *StagedEntryData) GetData() []byte
func (*StagedEntryData) GetIdentity ¶ added in v0.70.0
func (x *StagedEntryData) GetIdentity() []byte
func (*StagedEntryData) GetKey ¶ added in v0.70.0
func (x *StagedEntryData) GetKey() []byte
func (*StagedEntryData) ProtoMessage ¶ added in v0.70.0
func (*StagedEntryData) ProtoMessage()
func (*StagedEntryData) ProtoReflect ¶ added in v0.70.0
func (x *StagedEntryData) ProtoReflect() protoreflect.Message
func (*StagedEntryData) Reset ¶ added in v0.70.0
func (x *StagedEntryData) Reset()
func (*StagedEntryData) String ¶ added in v0.70.0
func (x *StagedEntryData) 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 // Update updates a (possibly nil) value under the given staging token and key. Update(ctx context.Context, st StagingToken, key Key, updateFunc ValueUpdateFunc) 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 // DropAsync clears the given staging area eventually. Keys may still exist under the token // for a short period of time after the request was made. DropAsync(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
func GenerateStagingToken ¶ added in v0.70.0
func GenerateStagingToken(repositoryID RepositoryID, branchID BranchID) StagingToken
func (StagingToken) String ¶ added in v0.70.0
func (id StagingToken) String() string
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 ProtoFromTag ¶ added in v0.70.0
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 TagRecord ¶
TagRecord holds TagID with the associated Tag data
func TagFromProto ¶ added in v0.70.0
type Value ¶
Value represents metadata or a given object (modified date, physical address, etc)
func StagedEntryFromProto ¶ added in v0.70.0
func StagedEntryFromProto(pb *StagedEntryData) *Value
type ValueIterator ¶
type ValueIterator interface { Next() bool SeekGE(id Key) Value() *ValueRecord Err() error Close() }
func NewCombinedIterator ¶
func NewCombinedIterator(iters ...ValueIterator) ValueIterator
NewCombinedIterator combines multiple ValueIterators into a single CombinedIterator. The returned iterator precedence order is first-to-last in case of matching keys in 2 or more iterators.
type ValueRecord ¶
ValueRecord holds Key with the associated Value information
func (*ValueRecord) IsTombstone ¶
func (v *ValueRecord) IsTombstone() bool
type ValueUpdateFunc ¶ added in v0.70.0
ValueUpdateFunc Used to pass validation call back to staging manager for UpdateValue flow
type VersionController ¶
type VersionController interface { // GetRepository returns the Repository metadata object for the given RepositoryID GetRepository(ctx context.Context, repositoryID RepositoryID) (*RepositoryRecord, 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) (*RepositoryRecord, error) // CreateBareRepository stores a new Repository under RepositoryID with no initial branch or commit CreateBareRepository(ctx context.Context, repositoryID RepositoryID, storageNamespace StorageNamespace, defaultBranchID BranchID) (*RepositoryRecord, 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, repository *RepositoryRecord, branchID BranchID, ref Ref) (*Branch, error) // UpdateBranch updates branch on repository pointing to ref UpdateBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref) (*Branch, error) // GetBranch gets branch information by branch / repository id GetBranch(ctx context.Context, repository *RepositoryRecord, branchID BranchID) (*Branch, error) // GetTag gets tag's commit id GetTag(ctx context.Context, repository *RepositoryRecord, tagID TagID) (*CommitID, error) // CreateTag creates tag on a repository pointing to a commit id CreateTag(ctx context.Context, repository *RepositoryRecord, tagID TagID, commitID CommitID) error // DeleteTag remove tag from a repository DeleteTag(ctx context.Context, repository *RepositoryRecord, tagID TagID) error // ListTags lists tags on a repository ListTags(ctx context.Context, repository *RepositoryRecord) (TagIterator, error) // Log returns an iterator starting at commit ID up to repository root Log(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (CommitIterator, error) // ListBranches lists branches on repositories ListBranches(ctx context.Context, repository *RepositoryRecord) (BranchIterator, error) // DeleteBranch deletes branch from repository DeleteBranch(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, 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, repository *RepositoryRecord, 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, repository *RepositoryRecord, 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, repository *RepositoryRecord, commit Commit) (CommitID, error) // GetCommit returns the Commit metadata object for the given CommitID GetCommit(ctx context.Context, repository *RepositoryRecord, commitID CommitID) (*Commit, error) // Dereference returns the resolved ref information based on 'ref' reference Dereference(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, rawRef RawRef) (*ResolvedRef, error) // Reset throws all staged data on the repository / branch Reset(ctx context.Context, repository *RepositoryRecord, branchID BranchID) error // ResetKey throws all staged data under the specified key on the repository / branch ResetKey(ctx context.Context, repository *RepositoryRecord, branchID BranchID, key Key) error // ResetPrefix throws all staged data starting with the given prefix on the repository / branch ResetPrefix(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, 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, repository *RepositoryRecord, 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, repository *RepositoryRecord, 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, repository *RepositoryRecord, 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, repository *RepositoryRecord, 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, repository *RepositoryRecord, branchID BranchID) (*StagingToken, error) GetGarbageCollectionRules(ctx context.Context, repository *RepositoryRecord) (*GarbageCollectionRules, error) SetGarbageCollectionRules(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, previousRunID string) (garbageCollectionRunMetadata *GarbageCollectionRunMetadata, err error) // GetBranchProtectionRules return all branch protection rules for the repository GetBranchProtectionRules(ctx context.Context, repository *RepositoryRecord) (*BranchProtectionRules, error) // DeleteBranchProtectionRule deletes the branch protection rule for the given pattern, // or return ErrRuleNotExists if no such rule exists. DeleteBranchProtectionRule(ctx context.Context, repository *RepositoryRecord, 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, repository *RepositoryRecord, 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