database

package
v0.0.0-...-c2a27a2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CdxjIndexName = "cdxjs"
	CdxjKeyPrefix = "cdxj:"
)

Variables

View Source
var (
	// Regular Expressions
	TokenDelimitersRe = regexp.MustCompile(`(\b|\B)([,.<>{}\[\]\"\':;!@#\$%\^&\*\(\)\-\+=~ ])(\b|\B)`)

	// Errors
	ErrNotFound = errors.New("cdxj record not found")
)

Functions

This section is empty.

Types

type CdxjRecords

type CdxjRecords interface {
	// Set sets the given record's fields in the datastore and returns the
	// records ID
	Set(rec models.Record) (string, error)

	// Get returns the record for the given record ID
	Get(recordId string) (models.Record, error)

	// Find searches the datastore for records that match the given values and
	// returns a list of matching records
	Find(
		surt string,
		types []string,
		before, after int64,
		match string,
		limit int,
	) (models.Records, error)
}

CdxjRecords represents the interface an CDXJ records datastore

func New

func New(ctx context.Context, addr string, drop bool) (CdxjRecords, error)

New returns a new CdxjRecords datastore

Jump to

Keyboard shortcuts

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