Documentation
¶
Overview ¶
Package chronam describes various internal structures for deserializing data from the live app's APIs and data
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchIssueXML ¶
type BatchIssueXML struct { EditionOrder string `xml:"editionOrder,attr"` Date string `xml:"issueDate,attr"` LCCN string `xml:"lccn,attr"` Content string `xml:",innerxml"` }
BatchIssueXML describes each <issue> element in the batch XML
type BatchJSON ¶
type BatchJSON struct { Name string Issues []*IssueMetadata LCCNs []string }
BatchJSON is what we get from a batch-details API request
func ParseBatchJSON ¶
ParseBatchJSON takes a pile of bytes and attempts to convert them into a BatchJSON structure. If json.Unmarshal has an error, it will be returned along with a nil object.
type BatchMetadata ¶
BatchMetadata holds the high-level batch metadata: name and URL to query detailed batch information
type BatchXML ¶
type BatchXML struct { XMLName xml.Name `xml:"batch"` Issues []BatchIssueXML `xml:"issue"` }
BatchXML is used to deserialize batch.xml files to get at their issues list
func ParseBatchXML ¶
ParseBatchXML opens the given batch.xml file for a given batch path and returns the decoded XML structure. This is intended primarily for retrieving the list of issues in a batch.
type BatchesListJSON ¶
type BatchesListJSON struct { Batches []*BatchMetadata Next string }
BatchesListJSON is what we get from a batches API request. It stores the list of batches' metadata and the link to the next page of results, if one is present.
func ParseBatchesListJSON ¶
func ParseBatchesListJSON(encoded []byte) (*BatchesListJSON, error)
ParseBatchesListJSON takes a pile of bytes and attempts to convert them into a BatchesListJSON structure. If json.Unmarshal has an error, it will be returned along with a nil object.
type DescriptiveMetadata ¶
type DescriptiveMetadata struct { ID string `xml:"ID,attr"` Data mods.Data `xml:"mdWrap>xmlData>mods"` }
DescriptiveMetadata holds the <dmdSec> stuff
type IssueMetadata ¶
type IssueMetadata struct { URL string Date string `json:"date_issued"` Title struct { URL string Name string } }
IssueMetadata is stored in a batch's issue list and gives us the information we need to query issue and title details
type METSHeader ¶
type METSHeader struct {
CreateDate string `xml:"CREATEDATE,attr"`
}
METSHeader just gives us the XML file's creation date
type METSIssue ¶
type METSIssue struct { XMLName xml.Name `xml:"mets"` Label string `xml:"LABEL,attr"` Header METSHeader `xml:"metsHdr"` DMDSecs []DescriptiveMetadata `xml:"dmdSec"` }
A METSIssue stores deserialized issue XML, but at this time it *cannot* be reserialized due to bugs in how Go handles namespaces. This is primarily for converting live issues into data structures which can then be serialized out again to verify the correctness of our custom METS output.
func ParseMETSIssueXML ¶
ParseMETSIssueXML reads the given file to extract the relevant METSIssue data
type TitleJSON ¶
type TitleJSON struct { LCCN string Name string PlaceOfPublication string Place []string StartYear string EndYear string Subject []string }
TitleJSON is what we get from a title-details API request
func ParseTitleJSON ¶
ParseTitleJSON takes a pile of bytes and attempts to convert them into a TitleJSON structure. If json.Unmarshal has an error, it will be returned along with a nil object.