testutil

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBranchID = graveler.BranchID("main")

Variables

This section is empty.

Functions

func NewCommittedValueIteratorFake

func NewCommittedValueIteratorFake(records []committed.Record) *committedValueIteratorFake

func NewDiffIter

func NewDiffIter(records []graveler.Diff) *diffIter

func NewFakeBranchIteratorFactory added in v0.43.0

func NewFakeBranchIteratorFactory(data []*graveler.BranchRecord) func() graveler.BranchIterator

func NewValueIteratorFake

func NewValueIteratorFake(records []graveler.ValueRecord) graveler.ValueIterator

Types

type AddedCommitData

type AddedCommitData struct {
	Committer   string
	Message     string
	MetaRangeID graveler.MetaRangeID
	Parents     graveler.CommitParents
	Metadata    graveler.Metadata
}

type AppliedData

type AppliedData struct {
	Values      graveler.ValueIterator
	MetaRangeID graveler.MetaRangeID
}

type CommittedFake

type CommittedFake struct {
	ValuesByKey   map[string]*graveler.Value
	ValueIterator graveler.ValueIterator
	DiffIterator  graveler.DiffIterator
	Err           error
	MetaRangeID   graveler.MetaRangeID
	DiffSummary   graveler.DiffSummary
	AppliedData   AppliedData
}

func (*CommittedFake) GetMetaRange

func (*CommittedFake) GetRange

func (*CommittedFake) WriteMetaRange

type DRV added in v0.40.0

type DRV struct {
	R *committed.RangeDiff
	V *graveler.Diff
}

type FakeBranchIterator added in v0.43.0

type FakeBranchIterator struct {
	Data  []*graveler.BranchRecord
	Index int
}

func NewFakeBranchIterator added in v0.43.0

func NewFakeBranchIterator(data []*graveler.BranchRecord) *FakeBranchIterator

func (*FakeBranchIterator) Close added in v0.43.0

func (m *FakeBranchIterator) Close()

func (*FakeBranchIterator) Err added in v0.43.0

func (m *FakeBranchIterator) Err() error

func (*FakeBranchIterator) Next added in v0.43.0

func (m *FakeBranchIterator) Next() bool

func (*FakeBranchIterator) SeekGE added in v0.43.0

func (m *FakeBranchIterator) SeekGE(id graveler.BranchID)

func (*FakeBranchIterator) Value added in v0.43.0

type FakeDiffIterator added in v0.40.0

type FakeDiffIterator struct {
	DRV []DRV
	// contains filtered or unexported fields
}

func NewFakeDiffIterator added in v0.40.0

func NewFakeDiffIterator() *FakeDiffIterator

func (*FakeDiffIterator) AddRange added in v0.40.0

func (*FakeDiffIterator) AddValueRecords added in v0.40.0

func (i *FakeDiffIterator) AddValueRecords(vs ...*graveler.Diff) *FakeDiffIterator

func (*FakeDiffIterator) Close added in v0.40.0

func (i *FakeDiffIterator) Close()

func (*FakeDiffIterator) Err added in v0.40.0

func (i *FakeDiffIterator) Err() error

func (*FakeDiffIterator) Next added in v0.40.0

func (i *FakeDiffIterator) Next() bool

func (*FakeDiffIterator) NextRange added in v0.40.0

func (i *FakeDiffIterator) NextRange() bool

func (*FakeDiffIterator) ReadsByRange added in v0.40.0

func (i *FakeDiffIterator) ReadsByRange() []int

ReadsByRange returns the number of Next operations performed inside each range

func (*FakeDiffIterator) SeekGE added in v0.40.0

func (i *FakeDiffIterator) SeekGE(id graveler.Key)

func (*FakeDiffIterator) SetErr added in v0.40.0

func (i *FakeDiffIterator) SetErr(err error)

func (*FakeDiffIterator) Value added in v0.40.0

type FakeIterator

type FakeIterator struct {
	RV []RV
	// contains filtered or unexported fields
}

func NewFakeIterator

func NewFakeIterator() *FakeIterator

func (*FakeIterator) AddRange

func (i *FakeIterator) AddRange(p *committed.Range) *FakeIterator

func (*FakeIterator) AddValueRecords

func (i *FakeIterator) AddValueRecords(vs ...*graveler.ValueRecord) *FakeIterator

func (*FakeIterator) Close

func (i *FakeIterator) Close()

func (*FakeIterator) Err

func (i *FakeIterator) Err() error

func (*FakeIterator) Next

func (i *FakeIterator) Next() bool

func (*FakeIterator) NextRange

func (i *FakeIterator) NextRange() bool

func (*FakeIterator) ReadsByRange

func (i *FakeIterator) ReadsByRange() []int

ReadsByRange returns the number of Next operations performed inside each range

func (*FakeIterator) SeekGE

func (i *FakeIterator) SeekGE(id graveler.Key)

func (*FakeIterator) SetErr

func (i *FakeIterator) SetErr(err error)

func (*FakeIterator) Value

type MetaRangeFake

type MetaRangeFake struct {
	// contains filtered or unexported fields
}

func (*MetaRangeFake) ID

type RV

type RV struct {
	R *committed.Range
	V *graveler.ValueRecord
}

type RefsFake

type RefsFake struct {
	ListRepositoriesRes graveler.RepositoryIterator
	ListBranchesRes     graveler.BranchIterator
	Refs                map[graveler.Ref]*graveler.ResolvedRef
	ListTagsRes         graveler.TagIterator
	CommitIter          graveler.CommitIterator
	RefType             graveler.ReferenceType
	Branch              *graveler.Branch
	TagCommitID         *graveler.CommitID
	Err                 error
	CommitErr           error
	AddedCommit         AddedCommitData
	CommitID            graveler.CommitID
	Commits             map[graveler.CommitID]*graveler.Commit
}

func (*RefsFake) AddCommit

func (*RefsFake) CreateBareRepository

func (m *RefsFake) CreateBareRepository(ctx context.Context, repositoryID graveler.RepositoryID, repository graveler.Repository) error

func (*RefsFake) DeleteBranch

func (*RefsFake) DeleteRepository

func (m *RefsFake) DeleteRepository(context.Context, graveler.RepositoryID) error

func (*RefsFake) DeleteTag

func (*RefsFake) FillGenerations added in v0.41.1

func (m *RefsFake) FillGenerations(ctx context.Context, repositoryID graveler.RepositoryID) error

func (*RefsFake) FindMergeBase

func (*RefsFake) GetCommit

func (*RefsFake) GetRepository

func (*RefsFake) ListBranches

func (*RefsFake) ListCommits

func (m *RefsFake) ListCommits(ctx context.Context, repositoryID graveler.RepositoryID) (graveler.CommitIterator, error)

func (*RefsFake) ListRepositories

func (m *RefsFake) ListRepositories(context.Context) (graveler.RepositoryIterator, error)

func (*RefsFake) ListTags

func (*RefsFake) ParseRef added in v0.44.1

func (m *RefsFake) ParseRef(ref graveler.Ref) (graveler.RawRef, error)

func (*RefsFake) ResolveRawRef added in v0.44.1

func (m *RefsFake) ResolveRawRef(ctx context.Context, repoID graveler.RepositoryID, rawRef graveler.RawRef) (*graveler.ResolvedRef, error)

type StagingFake

type StagingFake struct {
	Err           error
	DropErr       error // specific error for drop call
	Value         *graveler.Value
	ValueIterator graveler.ValueIterator

	LastSetValueRecord *graveler.ValueRecord
	LastRemovedKey     graveler.Key
	DropCalled         bool
	SetErr             error
	// contains filtered or unexported fields
}

func (*StagingFake) Drop

func (*StagingFake) DropByPrefix

func (*StagingFake) DropKey

func (*StagingFake) Get

func (*StagingFake) Set

func (*StagingFake) Snapshot

Jump to

Keyboard shortcuts

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