repositories

package
v0.0.0-...-ab1f78f Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const PageLimit = 100

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Config

type Config struct {
	Conn   string
	Secret []byte
}

type Repo

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

func New

func New(c Config) (*Repo, error)

func (*Repo) AddItem

func (r *Repo) AddItem(ctx context.Context, identifier string, specs []string) error

func (*Repo) AddMetadataFormat

func (r *Repo) AddMetadataFormat(ctx context.Context, prefix, schema, namespace string) error

func (*Repo) AddRecord

func (r *Repo) AddRecord(ctx context.Context, identifier, prefix, metadata string) error

func (*Repo) AddSet

func (r *Repo) AddSet(ctx context.Context, spec, name, description string) error

func (*Repo) DeleteRecord

func (r *Repo) DeleteRecord(ctx context.Context, identifier, prefix string) error

func (*Repo) GetEarliestDatestamp

func (r *Repo) GetEarliestDatestamp(ctx context.Context) (time.Time, error)

func (*Repo) GetIdentifiers

func (r *Repo) GetIdentifiers(ctx context.Context,
	metadataPrefix string,
	setSpec string,
	from string,
	until string,
) ([]*oaipmh.Header, *oaipmh.ResumptionToken, error)

TODO this loads the complete record, make an efficient version

func (*Repo) GetMetadataFormats

func (r *Repo) GetMetadataFormats(ctx context.Context) ([]*oaipmh.MetadataFormat, error)

func (*Repo) GetMoreIdentifiers

func (r *Repo) GetMoreIdentifiers(ctx context.Context, tokenValue string) ([]*oaipmh.Header, *oaipmh.ResumptionToken, error)

TODO this loads the complete record, maken an efficient version

func (*Repo) GetMoreRecords

func (r *Repo) GetMoreRecords(ctx context.Context, tokenValue string) ([]*oaipmh.Record, *oaipmh.ResumptionToken, error)

func (*Repo) GetMoreSets

func (r *Repo) GetMoreSets(ctx context.Context, tokenValue string) ([]*oaipmh.Set, *oaipmh.ResumptionToken, error)

func (*Repo) GetRecord

func (r *Repo) GetRecord(ctx context.Context, identifier, prefix string) (*oaipmh.Record, error)

func (*Repo) GetRecordMetadataFormats

func (r *Repo) GetRecordMetadataFormats(ctx context.Context, identifier string) ([]*oaipmh.MetadataFormat, error)

TODO scan directly into []*oaipmh.MetadataFormat?

func (*Repo) GetRecords

func (r *Repo) GetRecords(ctx context.Context,
	metadataPrefix string,
	setSpec string,
	from string,
	until string,
) ([]*oaipmh.Record, *oaipmh.ResumptionToken, error)

func (*Repo) GetSets

func (r *Repo) GetSets(ctx context.Context) ([]*oaipmh.Set, *oaipmh.ResumptionToken, error)

func (*Repo) HasMetadataFormat

func (r *Repo) HasMetadataFormat(ctx context.Context, prefix string) (bool, error)

func (*Repo) HasRecord

func (r *Repo) HasRecord(ctx context.Context, identifier string) (bool, error)

func (*Repo) HasSet

func (r *Repo) HasSet(ctx context.Context, spec string) (bool, error)

func (*Repo) HasSets

func (r *Repo) HasSets(ctx context.Context) (bool, error)

Jump to

Keyboard shortcuts

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