Documentation ¶
Index ¶
- func CompareAsc(a int64, b int64) bool
- func CompareClosest(ts int64) func(int64, int64) bool
- func CompareDesc(a int64, b int64) bool
- type DB
- func (db *DB) Close()
- func (db *DB) Closest(ctx context.Context, req index.ClosestRequest, res chan<- index.CdxResponse) error
- func (db *DB) GetFileInfo(_ context.Context, filename string) (*schema.Fileinfo, error)
- func (db *DB) GetStorageRef(ctx context.Context, id string) (string, error)
- func (db *DB) Index(path string) error
- func (db *DB) List(ctx context.Context, limit int, res chan<- index.CdxResponse) error
- func (db *DB) ListFileInfo(ctx context.Context, limit int, res chan<- index.FileResponse) error
- func (db *DB) ListStorageRef(ctx context.Context, limit int, res chan<- index.IdResponse) error
- func (db *DB) Resolve(ctx context.Context, warcId string) (string, error)
- func (db *DB) ResolvePath(filename string) (filePath string, err error)
- func (db *DB) Search(ctx context.Context, req index.SearchRequest, res chan<- index.CdxResponse) error
- func (db *DB) Write(rec index.Record) error
- type KV
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareAsc ¶
func CompareDesc ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Close ¶
func (db *DB) Close()
Close stops the batch workers and closes the index databases.
func (*DB) Closest ¶
func (db *DB) Closest(ctx context.Context, req index.ClosestRequest, res chan<- index.CdxResponse) error
Closest returns the first closest cdx value(s).
func (*DB) GetFileInfo ¶
func (*DB) GetStorageRef ¶
func (*DB) ListFileInfo ¶
func (*DB) ListStorageRef ¶
func (*DB) Resolve ¶
Resolve looks up warcId in the id index of the database and returns corresponding storageRef, or an error if not found.
func (*DB) ResolvePath ¶
ResolvePath looks up filename in file index and returns the path field.
func (*DB) Search ¶
func (db *DB) Search(ctx context.Context, req index.SearchRequest, res chan<- index.CdxResponse) error
type Option ¶
type Option func(opts *Options)
func WithBatchMaxSize ¶
func WithBatchMaxWait ¶
func WithDatabase ¶
func WithPDAddress ¶
func WithReadOnly ¶
Click to show internal directories.
Click to hide internal directories.