Documentation ¶
Overview ¶
Package packdb implements kcd.ReadWriter using an index pack as its backing store. See also: http://www.kythe.io/docs/kythe-index-pack.html.
Index ¶
- type DB
- func (db DB) Files(ctx context.Context, fileDigests []string, f func(string, []byte) error) error
- func (db DB) FilesExist(ctx context.Context, fileDigests []string, f func(string) error) error
- func (db DB) Find(ctx context.Context, filter *kcd.FindFilter, f func(string) error) error
- func (db DB) Revisions(ctx context.Context, want *kcd.RevisionsFilter, f func(kcd.Revision) error) error
- func (db DB) Units(ctx context.Context, unitDigests []string, ...) error
- func (db *DB) WriteFile(ctx context.Context, r io.Reader) (string, error)
- func (db *DB) WriteRevision(_ context.Context, rev kcd.Revision, replace bool) error
- func (db *DB) WriteUnit(ctx context.Context, revision, corpus, formatKey string, unit kcd.Unit) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct { Archive *indexpack.Archive FormatKey string // default format key Revs []kcd.Revision // revision index Convert func(v interface{}) (kcd.Unit, bool) // unit format converter }
DB implements kcd.ReadWriter using an index pack as its backing store.
An index pack does not record revision and corpus information, so this implementation emulates that with ephemeral data in-memory. Revision markers written will be discarded when the DB is released.
func (DB) FilesExist ¶
FilesExist implements a method of kcd.Reader.
func (DB) Revisions ¶
func (db DB) Revisions(ctx context.Context, want *kcd.RevisionsFilter, f func(kcd.Revision) error) error
Revisions implements a method of kcd.Reader.
func (DB) Units ¶
func (db DB) Units(ctx context.Context, unitDigests []string, f func(digest, key string, data []byte) error) error
Units implements a method of kcd.Reader.
func (*DB) WriteRevision ¶
WriteRevision implements a method of kcd.Writer. This implementation stores revisions only in memory, they are not persisted in the indexpack.