Documentation ¶
Overview ¶
Package indextest contains the unit tests for the indexer so they can be re-used for each specific implementation of the index Storage interface.
Index ¶
- func Delete(t *testing.T, initIdx func() *index.Index)
- func EdgesTo(t *testing.T, initIdx func() *index.Index)
- func EnumStat(t *testing.T, initIdx func() *index.Index)
- func Files(t *testing.T, initIdx func() *index.Index)
- func Index(t *testing.T, initIdx func() *index.Index)
- func MustNew(t *testing.T, s sorted.KeyValue) *index.Index
- func PathsOfSignerTarget(t *testing.T, initIdx func() *index.Index)
- func Reindex(t *testing.T, initIdx func() *index.Index)
- func ShowReindexRace(t *testing.T, initIdx func() *index.Index)
- type Fataler
- type IndexDeps
- func (id *IndexDeps) AddAttribute(permaNode blob.Ref, attr, value string) blob.Ref
- func (id *IndexDeps) DelAttribute(permaNode blob.Ref, attr, value string) blob.Ref
- func (id *IndexDeps) Delete(target blob.Ref) blob.Ref
- func (id *IndexDeps) DumpIndex(t *testing.T)
- func (id *IndexDeps) Get(key string) string
- func (id *IndexDeps) LastTime() time.Time
- func (id *IndexDeps) NewPermanode() blob.Ref
- func (id *IndexDeps) NewPlannedPermanode(key string) blob.Ref
- func (id *IndexDeps) Set(key, value string) error
- func (id *IndexDeps) SetAttribute(permaNode blob.Ref, attr, value string) blob.Ref
- func (id *IndexDeps) SetAttribute_NoTimeMove(permaNode blob.Ref, attr, value string) blob.Ref
- func (id *IndexDeps) UploadDir(dirName string, children []blob.Ref, modTime time.Time) blob.Ref
- func (id *IndexDeps) UploadFile(fileName string, contents string, modTime time.Time) (fileRef, wholeRef blob.Ref)
- func (id *IndexDeps) UploadString(v string) blob.Ref
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IndexDeps ¶
type IndexDeps struct { Index *index.Index BlobSource *test.Fetcher // Following three needed for signing: PublicKeyFetcher *test.Fetcher EntityFetcher jsonsign.EntityFetcher // fetching decrypted openpgp entities SignerBlobRef blob.Ref Fataler // optional means of failing. // contains filtered or unexported fields }
An IndexDeps is a helper for populating and querying an Index for tests.
func NewIndexDeps ¶
NewIndexDeps returns an IndexDeps helper for populating and working with the provided index for tests.
func (*IndexDeps) AddAttribute ¶
func (*IndexDeps) DelAttribute ¶
func (*IndexDeps) NewPermanode ¶
NewPermanode creates (& signs) a new permanode and adds it to the index, returning its blobref.
func (*IndexDeps) NewPlannedPermanode ¶
NewPermanode creates (& signs) a new planned permanode and adds it to the index, returning its blobref.
func (*IndexDeps) SetAttribute ¶
func (*IndexDeps) SetAttribute_NoTimeMove ¶
Click to show internal directories.
Click to hide internal directories.