indextest

package
v0.0.0-...-10d000d Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2013 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EdgesTo

func EdgesTo(t *testing.T, initIdx func() *index.Index)

func Files

func Files(t *testing.T, initIdx func() *index.Index)

func Index

func Index(t *testing.T, initIdx func() *index.Index)

func PathsOfSignerTarget

func PathsOfSignerTarget(t *testing.T, initIdx func() *index.Index)

Types

type Fataler

type Fataler interface {
	Fatalf(format string, args ...interface{})
}

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    *blobref.BlobRef

	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

func NewIndexDeps(index *index.Index) *IndexDeps

NewIndexDeps returns an IndexDeps helper for populating and working with the provided index for tests.

func (*IndexDeps) AddAttribute

func (id *IndexDeps) AddAttribute(permaNode *blobref.BlobRef, attr, value string) *blobref.BlobRef

func (*IndexDeps) DelAttribute

func (id *IndexDeps) DelAttribute(permaNode *blobref.BlobRef, attr string) *blobref.BlobRef

func (*IndexDeps) Get

func (id *IndexDeps) Get(key string) string

func (*IndexDeps) NewPermanode

func (id *IndexDeps) NewPermanode() *blobref.BlobRef

NewPermanode creates (& signs) a new permanode and adds it to the index, returning its blobref.

func (*IndexDeps) NewPlannedPermanode

func (id *IndexDeps) NewPlannedPermanode(key string) *blobref.BlobRef

NewPermanode creates (& signs) a new planned permanode and adds it to the index, returning its blobref.

func (*IndexDeps) SetAttribute

func (id *IndexDeps) SetAttribute(permaNode *blobref.BlobRef, attr, value string) *blobref.BlobRef

func (*IndexDeps) UploadFile

func (id *IndexDeps) UploadFile(fileName string, contents string, modTime time.Time) (fileRef, wholeRef *blobref.BlobRef)

If modTime is zero, it's not used.

Jump to

Keyboard shortcuts

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