Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexBibsysAuthority ¶
func IndexBibsysAuthority(res *ProcessedRecord, mrc marc.Record)
func IndexBibsysPublication ¶
func IndexBibsysPublication(res *ProcessedRecord, mrc marc.Record)
Types ¶
type DBRecord ¶
type DBRecord struct { Source string ID string Data []byte // gzipped XML NewData []byte // gzipped XML CreatedAt time.Time UpdatedAt time.Time ArchivedAt time.Time }
DBRecord represents an OAI record as it is stored in local DB.
type HarvestJob ¶
func (*HarvestJob) Name ¶
func (h *HarvestJob) Name() string
type HarvestPublishersJob ¶
func (*HarvestPublishersJob) Name ¶
func (h *HarvestPublishersJob) Name() string
type Harvester ¶
type Harvester struct { DB *sqlitex.Pool Endpoint string Source string Set string Prefix string StartAt time.Time Token string Process ProcessFunc Enqueue bool // if true, don't overwrite data column, but set queued_at timestamp, and store data in new_data column }
Harvester represents a OAI harvester, capable of harvesting records from a remote repository and sync to a local DB.
type Indexer ¶
type Indexer struct { DB *sqlitex.Pool Source string Process ProcessFunc ResetQueued bool }
TODO rename to IdentifierIndexer
type ProcessFunc ¶
type ProcessFunc func(RemoteRecord) (ProcessedRecord, error)
type ProcessedRecord ¶
type ProcessedRecord struct { DBRecord // For search indexing: // TODO maybe remove these, not really needed except for testing now Type string Label string // [0] = key (isbn/ismn/viaf), [1] = id Identifiers [][2]string }
ProcessedRecord represent a OAI Record which has been processed extracting relevant information needed for storage in DB and indexing in search index.
func ProcessBibsys ¶
func ProcessBibsys(rec RemoteRecord) (ProcessedRecord, error)
type Publisher ¶
type Publisher struct { ID string Name string FullName string AltName string WWW string ISBNPrefixes []string Notes []string CreatedAt string UpdatedAt string }
Publisher is a entry in NB isbn publisher database (https://nb.no/isbnforlag) Not an oai source, but we store it as oai records for now. TODO consider expanding oai db to handle all externally data sources which are kept in sync locally
func (Publisher) Resource ¶
func (p Publisher) Resource() sirkulator.Resource
type RemoteRecord ¶
type RemoteRecord struct { Header struct { Status string `xml:"status,attr"` Identifier string `xml:"identifier"` Datestamp time.Time `xml:"datestamp"` } `xml:"header"` Metadata []byte `xml:",innerxml"` // marcxml }
RemoteRecord represents a OAI record retrieved from an OAI/PMH repository.