index

package
v0.0.0-...-13d4fa3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVIndex

type CSVIndex struct {
	// contains filtered or unexported fields
}

A CSVIndex is an index based on a list of DOI, ID pairs in CSV format. The DOI should be lower cased and the list should be ordered by DOI.

func NewCSVIndex

func NewCSVIndex(p string) (*CSVIndex, error)

func (*CSVIndex) LookupDOI

func (ci *CSVIndex) LookupDOI(doi string) (uint64, error)

func (*CSVIndex) RandomDOI

func (ci *CSVIndex) RandomDOI() (KV, error)

type Cache

type Cache struct {
	*sync.RWMutex
	// contains filtered or unexported fields
}

func NewCache

func NewCache(original Index) *Cache

func (*Cache) LookupDOI

func (c *Cache) LookupDOI(doi string) (uint64, error)

func (*Cache) RandomDOI

func (c *Cache) RandomDOI() (KV, error)

type Index

type Index interface {
	LookupDOI(doi string) (uint64, error)
	RandomDOI() (KV, error)
}

type KV

type KV struct {
	DOI   string
	IDNum uint64
}

Jump to

Keyboard shortcuts

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