Documentation ¶
Index ¶
- Constants
- Variables
- func IsNonEmptyString(s string) bool
- func IsValidBranchName(branch string) bool
- func IsValidReference(reference string) bool
- func IsValidRepositoryName(repository string) bool
- func MakeReference(branch string, commitID CommitID) string
- func NewCataloger(db db.Database, options ...CatalogerOption) catalog.Cataloger
- func ScanDBEntriesUntil(s DBScanner, p string) error
- func Validate(validators ValidateFields) error
- type Cache
- type CacheConfig
- type CatalogerOption
- type CommitID
- type DBBranchScanner
- type DBLineageScanner
- type DBLineageScannerOptions
- type DBScanner
- type DBScannerEntry
- type DBScannerOptions
- type DiffScanner
- type DummyCache
- type GetBranchIDFn
- type GetRepositoryFn
- type GetRepositoryIDFn
- type InternalObjectRef
- type LRUCache
- type LockType
- type MinMaxCommit
- type Ref
- type RelationType
- type StringRows
- type ValidateField
- type ValidateFields
- type ValidateFunc
- func ValidateBranchName(branch string) ValidateFunc
- func ValidateCommitMessage(message string) ValidateFunc
- func ValidateCommitter(name string) ValidateFunc
- func ValidateOptionalString(s string, validator func(string) bool) ValidateFunc
- func ValidatePath(name string) ValidateFunc
- func ValidatePhysicalAddress(addr string) ValidateFunc
- func ValidateReference(reference string) ValidateFunc
- func ValidateRepositoryName(repository string) ValidateFunc
- func ValidateStorageNamespace(storageNamespace string) ValidateFunc
Constants ¶
View Source
const ( ListEntriesMaxLimit = 1000 ListEntriesBranchBatchSize = 32 )
View Source
const ( MergeBatchSize = 256 MergeBatchChanBuffer = 10 )
View Source
const ( DBScannerDefaultBufferSize = 4096 BranchScannerMaxCommitsInFilter = 40 )
View Source
const ( CommittedID CommitID = -1 UncommittedID CommitID = 0 MaxCommitID CommitID = 1_000_000_000_000_000_000 MinCommitUncommittedIndicator = MaxCommitID TombstoneCommitID CommitID = 0 CommittedSuffix = ":HEAD" CommitPrefix = "~" InternalObjectRefSeparator = "$" InternalObjectRefFormat = "int:pbm:%s" InternalObjectRefParts = 3 )
View Source
const ( DirectoryTerminationValue = utf8.MaxRune DirectoryTermination = string(rune(DirectoryTerminationValue)) )
View Source
const DiffMaxLimit = 1000
View Source
const ListBranchesMaxLimit = 10000
View Source
const ListCommitsMaxLimit = 10000
View Source
const ListRepositoriesMaxLimit = 10000
View Source
const (
MaxReadQueue = 10
)
Variables ¶
View Source
var ErrMinCommitsMismatch = errors.New("MinCommits length mismatch")
Functions ¶
func IsNonEmptyString ¶
func IsValidBranchName ¶
func IsValidReference ¶
func IsValidRepositoryName ¶
func MakeReference ¶
func NewCataloger ¶
func NewCataloger(db db.Database, options ...CatalogerOption) catalog.Cataloger
func ScanDBEntriesUntil ¶
func Validate ¶
func Validate(validators ValidateFields) error
Types ¶
type Cache ¶
type Cache interface { Repository(repository string, setFn GetRepositoryFn) (*catalog.Repository, error) RepositoryID(repository string, setFn GetRepositoryIDFn) (int, error) BranchID(repository string, branch string, setFn GetBranchIDFn) (int64, error) }
type CacheConfig ¶
type CatalogerOption ¶
type CatalogerOption func(*cataloger)
func WithCacheEnabled ¶
func WithCacheEnabled(b bool) CatalogerOption
func WithDedupReportChannel ¶
func WithDedupReportChannel(b bool) CatalogerOption
func WithParams ¶
func WithParams(p params.Catalog) CatalogerOption
type DBBranchScanner ¶
type DBBranchScanner struct {
// contains filtered or unexported fields
}
func NewDBBranchScanner ¶
func NewDBBranchScanner(tx db.Tx, branchID int64, commitID, minCommitID CommitID, opts DBScannerOptions) *DBBranchScanner
func (*DBBranchScanner) Err ¶
func (s *DBBranchScanner) Err() error
func (*DBBranchScanner) Next ¶
func (s *DBBranchScanner) Next() bool
func (*DBBranchScanner) SetAdditionalWhere ¶
func (s *DBBranchScanner) SetAdditionalWhere(part sq.Sqlizer)
func (*DBBranchScanner) Value ¶
func (s *DBBranchScanner) Value() *DBScannerEntry
type DBLineageScanner ¶
type DBLineageScanner struct {
// contains filtered or unexported fields
}
func NewDBLineageScanner ¶
func NewDBLineageScanner(tx db.Tx, branchID int64, commitID CommitID, opts DBLineageScannerOptions) *DBLineageScanner
func (*DBLineageScanner) Err ¶
func (s *DBLineageScanner) Err() error
func (*DBLineageScanner) Next ¶
func (s *DBLineageScanner) Next() bool
func (*DBLineageScanner) ReadLineage ¶
func (s *DBLineageScanner) ReadLineage() ([]lineageCommit, error)
func (*DBLineageScanner) SetAdditionalWhere ¶
func (s *DBLineageScanner) SetAdditionalWhere(part sq.Sqlizer)
func (*DBLineageScanner) Value ¶
func (s *DBLineageScanner) Value() *DBScannerEntry
type DBLineageScannerOptions ¶
type DBLineageScannerOptions struct { DBScannerOptions Lineage []lineageCommit MinCommits []CommitID }
type DBScanner ¶
type DBScanner interface { Next() bool Value() *DBScannerEntry Err() error SetAdditionalWhere(s sq.Sqlizer) }
type DBScannerEntry ¶
type DBScannerEntry struct { BranchID int64 `db:"branch_id"` RowCtid string `db:"ctid"` MinMaxCommit catalog.Entry }
type DBScannerOptions ¶
type DiffScanner ¶
type DiffScanner struct { Relation RelationType // contains filtered or unexported fields }
func NewDiffScanner ¶
func NewDiffScanner(tx db.Tx, params doDiffParams) (*DiffScanner, error)
func (*DiffScanner) Error ¶
func (s *DiffScanner) Error() error
func (*DiffScanner) Next ¶
func (s *DiffScanner) Next() bool
func (*DiffScanner) Value ¶
func (s *DiffScanner) Value() *catalog.DiffResultRecord
type DummyCache ¶
type DummyCache struct{}
func (*DummyCache) BranchID ¶
func (c *DummyCache) BranchID(repository string, branch string, setFn GetBranchIDFn) (int64, error)
func (*DummyCache) Repository ¶
func (c *DummyCache) Repository(repository string, setFn GetRepositoryFn) (*catalog.Repository, error)
func (*DummyCache) RepositoryID ¶
func (c *DummyCache) RepositoryID(repository string, setFn GetRepositoryIDFn) (int, error)
type GetRepositoryFn ¶
type GetRepositoryFn func(repository string) (*catalog.Repository, error)
type GetRepositoryIDFn ¶
type InternalObjectRef ¶
InternalObjectRef provides information that uniquely identifies an object between transactions. It might be invalidated by some database changes.
func ParseInternalObjectRef ¶
func ParseInternalObjectRef(refString string) (InternalObjectRef, error)
func (*InternalObjectRef) String ¶
func (sor *InternalObjectRef) String() string
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
func (*LRUCache) Repository ¶
func (c *LRUCache) Repository(repository string, setFn GetRepositoryFn) (*catalog.Repository, error)
func (*LRUCache) RepositoryID ¶
func (c *LRUCache) RepositoryID(repository string, setFn GetRepositoryIDFn) (int, error)
type MinMaxCommit ¶
type MinMaxCommit struct { MinCommit CommitID `db:"min_commit"` MaxCommit CommitID `db:"max_commit"` }
func (MinMaxCommit) ChangedAfterCommit ¶
func (m MinMaxCommit) ChangedAfterCommit(commitID CommitID) bool
func (MinMaxCommit) IsCommitted ¶
func (m MinMaxCommit) IsCommitted() bool
func (MinMaxCommit) IsDeleted ¶
func (m MinMaxCommit) IsDeleted() bool
func (MinMaxCommit) IsTombstone ¶
func (m MinMaxCommit) IsTombstone() bool
type RelationType ¶
type RelationType string
const ( RelationTypeNone RelationType = "none" RelationTypeFromParent RelationType = "from_parent" RelationTypeFromChild RelationType = "from_child" RelationTypeNotDirect RelationType = "non_direct" RelationTypeSame RelationType = "same" )
type StringRows ¶
type StringRows struct {
// contains filtered or unexported fields
}
func (*StringRows) Close ¶
func (s *StringRows) Close()
func (*StringRows) Err ¶
func (s *StringRows) Err() error
func (*StringRows) Next ¶
func (s *StringRows) Next() bool
func (*StringRows) Read ¶
func (s *StringRows) Read() (string, error)
type ValidateField ¶
type ValidateField struct { Name string IsValid ValidateFunc }
type ValidateFields ¶
type ValidateFields []ValidateField
type ValidateFunc ¶
type ValidateFunc func() bool
func ValidateBranchName ¶
func ValidateBranchName(branch string) ValidateFunc
func ValidateCommitMessage ¶
func ValidateCommitMessage(message string) ValidateFunc
func ValidateCommitter ¶
func ValidateCommitter(name string) ValidateFunc
func ValidateOptionalString ¶
func ValidateOptionalString(s string, validator func(string) bool) ValidateFunc
func ValidatePath ¶
func ValidatePath(name string) ValidateFunc
func ValidatePhysicalAddress ¶
func ValidatePhysicalAddress(addr string) ValidateFunc
func ValidateReference ¶
func ValidateReference(reference string) ValidateFunc
func ValidateRepositoryName ¶
func ValidateRepositoryName(repository string) ValidateFunc
func ValidateStorageNamespace ¶
func ValidateStorageNamespace(storageNamespace string) ValidateFunc
Source Files ¶
- cache.go
- cataloger.go
- cataloger_cache.go
- cataloger_commit.go
- cataloger_create_branch.go
- cataloger_create_entries.go
- cataloger_create_entry.go
- cataloger_create_repository.go
- cataloger_delete_branch.go
- cataloger_delete_entry.go
- cataloger_delete_repository.go
- cataloger_diff.go
- cataloger_diff_uncommitted.go
- cataloger_export.go
- cataloger_get_branch_reference.go
- cataloger_get_commit.go
- cataloger_get_entry.go
- cataloger_get_repository.go
- cataloger_is_branch_exists.go
- cataloger_list_branches.go
- cataloger_list_commits.go
- cataloger_list_entries.go
- cataloger_list_repositories.go
- cataloger_merge.go
- cataloger_reset_branch.go
- cataloger_reset_entries.go
- cataloger_reset_entry.go
- cataloger_retention.go
- cataloger_rollback_commit.go
- db.go
- db_batch_entry_read.go
- db_branch_scanner.go
- db_diff_scanner.go
- db_lineage_scanner.go
- db_read_entry.go
- db_scanner.go
- model.go
- ref.go
- relation_type.go
- stats.go
- validate.go
- views.go
Click to show internal directories.
Click to hide internal directories.