Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OAIDC = &MetadataFormat{ MetadataPrefix: "oai_dc", Schema: "http://www.openarchives.org/OAI/2.0/oai_dc.xsd", MetadataNamespace: "http://www.openarchives.org/OAI/2.0/oai_dc/", } // TODO make all errors private and remove Error method ErrCannotDisseminateFormat = &Error{Code: "cannotDisseminateFormat", Value: "the metadata format identified by the value given for the metadataPrefix argument is not supported by the item or by the repository"} ErrBadResumptionToken = &Error{Code: "badResumptionToken", Value: "the value of the resumptionToken argument is invalid or expired"} )
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Identify ¶
type Identify struct { XMLName xml.Name `xml:"Identify"` RepositoryName string `xml:"repositoryName"` BaseURL string `xml:"baseURL"` ProtocolVersion string `xml:"protocolVersion"` AdminEmails []string `xml:"adminEmail"` Granularity string `xml:"granularity"` EarliestDatestamp string `xml:"earliestDatestamp"` Compression string `xml:"compression,omitempty"` DeletedRecord string `xml:"deletedRecord"` }
type ListIdentifiers ¶
type ListIdentifiers struct { XMLName xml.Name `xml:"ListIdentifiers"` Headers []*Header `xml:"header"` ResumptionToken *ResumptionToken `xml:"resumptionToken"` }
type ListMetadataFormats ¶
type ListMetadataFormats struct { XMLName xml.Name `xml:"ListMetadataFormats"` MetadataFormats []*MetadataFormat `xml:"metadataFormat"` }
type ListRecords ¶
type ListRecords struct { XMLName xml.Name `xml:"ListRecords"` Records []*Record `xml:"record"` ResumptionToken *ResumptionToken `xml:"resumptionToken"` }
type ListSets ¶
type ListSets struct { XMLName xml.Name `xml:"ListSets"` Sets []*Set `xml:"set"` ResumptionToken *ResumptionToken `xml:"resumptionToken"` }
type MetadataFormat ¶
type Provider ¶
type Provider struct { ProviderConfig // contains filtered or unexported fields }
func NewProvider ¶
func NewProvider(conf ProviderConfig) (*Provider, error)
type ProviderBackend ¶
type ProviderBackend interface { GetEarliestDatestamp(context.Context) (time.Time, error) HasMetadataFormat(context.Context, string) (bool, error) HasSets(context.Context) (bool, error) HasSet(context.Context, string) (bool, error) GetMetadataFormats(context.Context) ([]*MetadataFormat, error) GetRecordMetadataFormats(context.Context, string) ([]*MetadataFormat, error) GetSets(context.Context) ([]*Set, *ResumptionToken, error) GetMoreSets(context.Context, string) ([]*Set, *ResumptionToken, error) // TODO pass from, until as time objects GetIdentifiers(context.Context, string, string, string, string) ([]*Header, *ResumptionToken, error) GetMoreIdentifiers(context.Context, string) ([]*Header, *ResumptionToken, error) HasRecord(context.Context, string) (bool, error) GetRecords(context.Context, string, string, string, string) ([]*Record, *ResumptionToken, error) GetMoreRecords(context.Context, string) ([]*Record, *ResumptionToken, error) GetRecord(context.Context, string, string) (*Record, error) }
type ProviderConfig ¶
type ProviderConfig struct { RepositoryName string BaseURL string AdminEmails []string Granularity string Compression string DeletedRecord string StyleSheet string ErrorHandler func(error) Backend ProviderBackend }
TODO use context in callbacks
type ResumptionToken ¶
Click to show internal directories.
Click to hide internal directories.