Documentation
¶
Overview ¶
eprinttools.go is a package for working with EPrints 3.x REST API as well as XML artifacts on disc.
@author R. S. Doiel, <rsdoiel@library.caltech.edu>
Copyright (c) 2017, Caltech All rights not granted herein are expressly reserved by Caltech.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Package eprinttools is a collection of structures and functions for working with the E-Prints REST API ¶
@author R. S. Doiel, <rsdoiel@caltech.edu>
Copyright (c) 2017, Caltech All rights not granted herein are expressly reserved by Caltech.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index ¶
- Constants
- func GetKeys(baseURL string, authType int, username string, secret string) ([]string, error)
- func GetModifiedKeys(baseURL string, authType int, username string, secret string, start time.Time, ...) ([]string, error)
- type AccompanimentItemList
- type AltTitleItemList
- type ConductorItemList
- type ConfCreatorItemList
- type ContributorItemList
- type CopyrightHolderItemList
- type CorpCreatorItemList
- type CreatorItemList
- type DivisionItemList
- type Document
- type DocumentItemList
- type DocumentList
- type EPrint
- type EPrints
- type EPrintsAPI
- type EPrintsDataSet
- type EditorItemList
- type ErrataItemList
- type ExhibitorItemList
- type File
- type Funder
- type FunderItemList
- type FunderList
- type GScholarItemList
- type Generic
- type Item
- type ItemIssueItemList
- type ItemList
- type LearningLevelItemList
- type LocalGroupItemList
- type LyricistItemList
- type Name
- type NumberingSystem
- type OptionMajorItemList
- type OtherNumberingSystemItemList
- type PatentAssigneeItemList
- type PatentClassificationItemList
- type Person
- type PersonList
- type ProducerItemList
- type ProjectItemList
- type ReferenceItemList
- type ReferenceTextItemList
- type RelatedPatentItemList
- type RelatedURL
- type RelatedURLItemList
- type ShelfItemList
- type SkillAreaItemList
- type SubjectItemList
- type ThesisAdvisorItemList
- type ThesisCommitteeItemList
Constants ¶
const ( // Version is the revision number for this implementation of epgo Version = `v0.0.15` // LicenseText holds the string for rendering License info on the command line LicenseText = `` /* 1529-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func GetKeys ¶ added in v0.0.14
GetKeys returns a list of eprint record ids from the EPrints REST API
func GetModifiedKeys ¶ added in v0.0.15
func GetModifiedKeys(baseURL string, authType int, username string, secret string, start time.Time, end time.Time, verbose bool) ([]string, error)
GetModifiedKeys returns a list of eprint record ids from the EPrints REST API that match the modification date range
Types ¶
type AccompanimentItemList ¶ added in v0.0.14
type AccompanimentItemList struct { XMLName xml.Name `xml:"accompaniment" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
AccompanimentItemList
func (*AccompanimentItemList) AddItem ¶ added in v0.0.14
func (accompanimentItemList *AccompanimentItemList) AddItem(item *Item) int
AddItem adds an item to the accompaniment item list and returns the new count of items
type AltTitleItemList ¶ added in v0.0.14
type AltTitleItemList struct { XMLName xml.Name `xml:"alt_title" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
AltTitleItemList
func (*AltTitleItemList) AddItem ¶ added in v0.0.14
func (altTitleItemList *AltTitleItemList) AddItem(item *Item) int
AddItem adds an item to the altTitle item list and returns the new count of items
type ConductorItemList ¶ added in v0.0.14
type ConductorItemList struct { XMLName xml.Name `xml:"conductors" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ConductorItemList
func (*ConductorItemList) AddItem ¶ added in v0.0.14
func (conductorItemList *ConductorItemList) AddItem(item *Item) int
AddItem adds an item to the conductor item list and returns the new count of items
type ConfCreatorItemList ¶ added in v0.0.14
type ConfCreatorItemList struct { XMLName xml.Name `xml:"conf_creators" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ConfCreatorItemList
func (*ConfCreatorItemList) AddItem ¶ added in v0.0.14
func (confCreatorItemList *ConfCreatorItemList) AddItem(item *Item) int
AddItem adds an item to the confCreator item list and returns the new count of items
type ContributorItemList ¶ added in v0.0.14
type ContributorItemList struct { XMLName xml.Name `xml:"contributors" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ContributorItemList
func (*ContributorItemList) AddItem ¶ added in v0.0.14
func (contributorItemList *ContributorItemList) AddItem(item *Item) int
AddItem adds an item to the contributor item list and returns the new count of items
type CopyrightHolderItemList ¶ added in v0.0.14
type CopyrightHolderItemList struct { XMLName xml.Name `xml:"copyright_holders" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
CopyrightHolderItemList
func (*CopyrightHolderItemList) AddItem ¶ added in v0.0.14
func (copyrightHolderItemList *CopyrightHolderItemList) AddItem(item *Item) int
AddItem adds an item to the copyrightHolder item list and returns the new count of items
type CorpCreatorItemList ¶ added in v0.0.14
type CorpCreatorItemList struct { XMLName xml.Name `xml:"corp_creators" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
CorpCreatorItemList
func (*CorpCreatorItemList) AddItem ¶ added in v0.0.14
func (corpCreatorItemList *CorpCreatorItemList) AddItem(item *Item) int
AddItem adds an item to the corp creator item list and returns the new count of items
type CreatorItemList ¶ added in v0.0.14
type CreatorItemList struct { XMLName xml.Name `xml:"creators" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
CreatorItemList holds a list of authors
func (*CreatorItemList) AddItem ¶ added in v0.0.14
func (creatorItemList *CreatorItemList) AddItem(item *Item) int
AddItem adds an item to the Creator list and returns the new count of items
type DivisionItemList ¶ added in v0.0.14
type DivisionItemList struct { XMLName xml.Name `xml:"divisions" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
DivisionItemList
func (*DivisionItemList) AddItem ¶ added in v0.0.14
func (divisionItemList *DivisionItemList) AddItem(item *Item) int
AddItem adds an item to the division item list and returns the new count of items
type Document ¶
type Document struct { XMLName xml.Name `json:"-"` XMLNS string `xml:"xmlns,attr,omitempty" json:"name_space,omitempty"` ID string `xml:"id,attr" json:"id"` DocID int `xml:"docid" json:"doc_id"` RevNumber int `xml:"rev_number" json:"rev_number,omitempty"` Files []*File `xml:"files>file" json:"files,omitempty"` EPrintID int `xml:"eprintid" json:"eprint_id"` Pos int `xml:"pos" json:"pos,omitempty"` Placement int `xml:"placement" json:"placement,omitempty"` MimeType string `xml:"mime_type" json:"mime_type"` Format string `xml:"format" json:"format"` FormatDesc string `xml:"formatdesc,omitempty" json:"format_desc,omitempty"` Language string `xml:"language" json:"language"` Security string `xml:"security" json:"security"` License string `xml:"license" json:"license"` Main string `xml:"main" json:"main"` Content string `xml:"content" json:"content"` Relation []*Item `xml:"relation>item,omitempty" json:"relation,omitempty"` }
Document structures inside a Record (i.e. <eprint>...<documents><document>...</document>...</documents>...</eprint>)
type DocumentItemList ¶ added in v0.0.14
type DocumentItemList struct { XMLName xml.Name `xml:"documents" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
DocumentItemList holds the eprint documents
func (*DocumentItemList) AddItem ¶ added in v0.0.14
func (documentItemList *DocumentItemList) AddItem(item *Item) int
AddItem adds a document item to the documents list and returns the new count of items
type DocumentList ¶
type DocumentList []*Document
DocumentList is an array of pointers to Document structs
type EPrint ¶ added in v0.0.14
type EPrint struct { XMLName xml.Name `xml:"eprint" json:"-"` XMLNS string `xml:"xmlns,attr,omitempty" json:"xmlns,omitempty"` ID string `xml:"id,attr,omitempty" json:"id,omitempty"` EPrintID int `xml:"eprintid,omitempty" json:"eprint_id,omitempty"` RevNumber int `xml:"rev_number,omitempty" json:"rev_number,omitempty"` Documents *DocumentItemList `xml:"documents,omitempty" json:"documents,omitempty"` EPrintStatus string `xml:"eprint_status,omitempty" json:"eprint_status,omitempty"` UserID int `xml:"userid,omitempty" json:"userid,omitempty"` Dir string `xml:"dir,omitempty" json:"dir,omitempty"` DateStamp string `xml:"datestamp,omitempty" json:"datestamp,omitempty"` LastModified string `xml:"lastmod,omitempty" json:"lastmod,omitempty"` StatusChanged string `xml:"status_changed,omitempty" json:"status_changed,omitempty"` Type string `xml:"type,omitempty" json:"type,omitempty"` MetadataVisibility string `xml:"metadata_visibility,omitempty" json:"metadata_visibility,omitempty"` Creators *CreatorItemList `xml:"creators,omitempty" json:"creators,omitempty"` Title string `xml:"title,omitempty" json:"title,omitempty"` IsPublished string `xml:"ispublished,omitempty" json:"ispublished,omitempty"` FullTextStatus string `xml:"full_text_status,omitempty" json:"full_text_status,omitempty"` Keywords string `xml:"keywords,omitempty" json:"keywords,omitempty"` Note string `xml:"note,omitempty" json:"note,omitempty"` Abstract string `xml:"abstract,omitempty" json:"abstract,omitempty"` Date string `xml:"date,omitempty" json:"date,omitempty"` DateType string `xml:"date_type,omitempty" json:"date_type,omitempty"` Series string `xml:"series,omitempty" json:"series,omitempty"` Publication string `xml:"publication,omitempty" json:"publication,omitempty"` Volume string `xml:"volume,omitempty" json:"volume,omitempty"` Number string `xml:"number,omitempty" json:"number,omitempty"` Publisher string `xml:"publisher,omitempty" json:"publisher,omitempty"` PlaceOfPub string `xml:"place_of_pub,omitempty" json:"place_of_pub,omitempty"` Edition string `xml:"edition,omitempty" json:"edition,omitempty"` PageRange string `xml:"pagerange,omitempty" json:"pagerange,omitempty"` Pages string `xml:"pages,omitempty" json:"pages,omitempty"` EventTitle string `xml:"event_title,omitempty" json:"event_title,omitempty"` EventLocation string `xml:"event_location,omitempty" json:"event_location,omitempty"` EventDates string `xml:"event_dates,omitempty" json:"event_dates,omitempty"` IDNumber string `xml:"id_number,omitempty" json:"id_number,omitempty"` Refereed string `xml:"refereed,omitempty" json:"refereed,omitempty"` ISBN string `xml:"isbn,omitempty" json:"isbn,omitempty"` ISSN string `xml:"issn,omitempty" json:"issn,omitempty"` BookTitle string `xml:"book_title,omitempty" json:"book_title,omitempty"` Editors *EditorItemList `xml:"editors,omitempty" json:"editors,omitempty"` OfficialURL string `xml:"official_url,omitempty" json:"official_url,omitempty"` RelatedURL *RelatedURLItemList `xml:"related_url,omitempty" json:"related_url,omitempty"` ReferenceText *ReferenceTextItemList `xml:"referencetext,omitempty" json:"referencetext,omitempty"` Projects *ProjectItemList `xml:"projects,omitempty" json:"projects,omitempty"` Rights string `xml:"rights,omitempty" json:"rights,omitempty"` Funders *FunderItemList `xml:"funders,omitempty" json:"funders,omitempty"` Collection string `xml:"collection,omitempty" json:"collection,omitempty"` Reviewer string `xml:"reviewer,omitempty" json:"reviewer,omitempty"` OfficeCitation string `xml:"official_cit,omitempty" json:"official_cit,omitempty"` OtherNumberingSystem *OtherNumberingSystemItemList `xml:"other_numbering_system,omitempty" json:"other_numbering_system,omitempty"` LocalGroup *LocalGroupItemList `xml:"local_group,omitempty" json:"local_group,omitempty"` Errata *ErrataItemList `xml:"errata,omitempty" json:"errata,omitempty"` Contributors *ContributorItemList `xml:"contributors,omitempty" json:"contributors,omitempty"` MonographType string `xml:"monograph_type,omitempty" json:"monograph_type,omitempty"` // Caltech Library uses suggestions as an internal note field (RSD, 2018-02-15) Suggestions string `xml:"suggestions,omitempty" json:"suggestions,omitempty"` // NOTE: Misc fields discoverd exploring REST API records, not currently used at Caltech Library (RSD, 2018-01-02) Subjects *SubjectItemList `xml:"subjects,omitempty" json:"subjects,omitempty"` PresType string `xml:"pres_type,omitempty" json:"presentation_type,omitempty"` Succeeds string `xml:"succeeds,omitempty" json:"succeeds,omitempty"` Commentary string `xml:"commentary,omitempty" json:"commentary,omitempty"` ContactEMail string `xml:"contact_email,omitempty" json:"contect_email,omitempty"` FileInfo string `xml:"fileinfo,omitempty" json:"file_info,omitempty"` Latitude string `xml:"latitude,omitempty" json:"latitude,omitempty"` Longitude string `xml:"longitude,omitempty" json:"longitude,omitempty"` ItemIssues *ItemIssueItemList `xml:"item_issues,omitempty" json:"item_issues,omitempty"` ItemIssuesCount int `xml:"item_issues_count,omitempty" json:"item_issues_count,omitempty"` CorpCreators *CorpCreatorItemList `xml:"corp_creators,omitempty" json:"corp_creators,omitempty"` Department string `xml:"department,omitempty" json:"department,omitempty"` OutputMedia string `xml:"output_media,omitempty" json:"output_media,omitempty"` Exhibitors *ExhibitorItemList `xml:"exhibitors,omitempty" json:"exhibitors,omitempty"` NumPieces string `xml:"num_pieces,omitempty" json:"num_pieces,omitempty"` CompositionType string `xml:"composition_type,omitempty" json:"composition_type,omitempty"` Producers *ProducerItemList `xml:"producers,omitempty" json:"producers,omitempty"` Conductors *ConductorItemList `xml:"conductors,omitempty" json:"conductors,omitempty"` Lyricists *LyricistItemList `xml:"lyricists,omitempty" json:"lyricists,omitempty"` Accompaniment *AccompanimentItemList `xml:"accompaniment,omitempty" json:"accompaniment,omitempty"` DataType string `xml:"data_type,omitempty" json:"data_type,omitempty"` PedagogicType string `xml:"pedagogic_type,omitempty" json:"pedagogic_type,omitempty"` CompletionTime string `xml:"completion_time,omitempty" json:"completion_time,omitempty"` TaskPurpose string `xml:"task_purpose,omitempty" json:"task_purpose,omitempty"` SkillAreas *SkillAreaItemList `xml:"skill_areas,omitempty" json:"skill_areas,omitempty"` CopyrightHolders *CopyrightHolderItemList `xml:"copyright_holders,omitempty" json:"copyright_holders,omitempty"` LearningLevel *LearningLevelItemList `xml:"learning_level,omitempty" json:"learning_level,omitempty"` DOI string `xml:"doi,omitempty" json:"doi,omitempty"` PMCID string `xml:"pmc_id,omitempty" json:"pmc_id,omitempty"` PMID string `xml:"pmid,omitempty" json:"pmid,omitempty"` ParentURL string `xml:"parent_url,omitempty" json:"parent_url,omitempty"` AltURL string `xml:"alt_url,omitempty" json:"alt_url,omitempty"` Reference *ReferenceItemList `xml:"reference,omitempty" json:"reference,omitempty"` ConfCreators *ConfCreatorItemList `xml:"conf_creators,omitempty" json:"conf_creators,omitempty"` AltTitle *AltTitleItemList `xml:"alt_title,omitempty" json:"alt_title,omitempty"` TOC string `xml:"toc,omitempty" json:"toc,omitempty"` Interviewer string `xml:"interviewer,omitempty" json:"interviewer,omitempty"` InterviewDate string `xml:"interviewdate,omitempty" json:"interviewdate,omitempty"` GScholar *GScholarItemList `xml:"gscholar,omitempty" json:"gscholar,omitempty"` NonSubjKeywords string `xml:"nonsubj_keywords,omitempty" json:"nonsubj_keywords,omitempty"` Season string `xml:"season,omitempty" json:"season,omitempty"` ClassificationCode string `xml:"classification_code,omitempty" json:"classification_code,omitempty"` Shelves *ShelfItemList `xml:"shelves,omitempty" json:"shelves,omitempty"` // NOTE: Sword deposit fields SwordDepository string `xml:"sword_depository,omitempty" json:"sword_depository,omitempty"` SwordSlug string `xml:"sword_slug,omitempty" json:"sword_slug,omitempty"` ImportID string `xml:"importid,omitempty" json:"import_id,omitempty"` // Patent related fields PatentApplicant string `xml:"patent_applicant,omitempty" json:"patent_applicant,omitempty"` PatentNumber string `xml:"patent_number,omitempty" json:"patent_number,omitempty"` PatentAssignee *PatentAssigneeItemList `xml:"patent_assignee,omitempty" json:"patent_assignee,omitempty"` PatentClassification *PatentClassificationItemList `xml:"patent_classification,omitempty" json:"patent_classification,omitempty"` RelatedPatents *RelatedPatentItemList `xml:"related_patents,omitempty" json:"related_patents,omitempty"` // Thesis oriented fields Divisions *DivisionItemList `xml:"divisions,omitemmpty" json:"divisions,omitempty"` Institution string `xml:"institution,omitempty" json:"institution,omitempty"` ThesisType string `xml:"thesis_type,omitempty" json:"thesis_type,omitempty"` ThesisAdvisor *ThesisAdvisorItemList `xml:"thesis_advisor,omitempty" json:"thesis_advisor,omitempty"` ThesisCommittee *ThesisCommitteeItemList `xml:"thesis_committee,omitempty" json:"thesis_committee,omitempty"` ThesisDegree string `xml:"thesis_degree,omitempty" json:"thesis_degree,omitempty"` ThesisDegreeGrantor string `xml:"thesis_degree_grantor,omitempty" json:"thesis_degree_grantor,omitempty"` ThesisDegreeDate string `xml:"thesis_degree_date,omitempty" json:"thesis_degree_date,omitempty"` ThesisSubmittedDate string `xml:"thesis_submit_date,omitempty" json:"thesis_submit_date,omitempty"` ThesisDefenseDate string `xml:"thesis_defense_date,omitempty" json:"thesis_defense_date,omitempty"` ThesisApprovedDate string `xml:"thesis_approved_date,omitempty" json:"thesis_approved_date,omitempty"` ThesisPublicDate string `xml:"thesis_public_date,omitempty" json:"thesis_public_date,omitempty"` ThesisAuthorEMail string `xml:"thesis_author_email,omitempty" json:"thesis_author_email,omitempty"` HideThesisAuthorEMail string `xml:"hide_thesis_author_email,omitempty" json:"hide_thesis_author_email,omitempty"` GradOfficeApprovalDate string `xml:"gradofc_approval_date,omitempty" json:"gradofc_approval_date,omitempty"` ThesisAwards string `xml:"thesis_awards,omitempty" json:"thesis_awards,omitempty"` ReviewStatus string `xml:"review_status,omitempty" json:"review_status,omitempty"` OptionMajor *OptionMajorItemList `xml:"option_major,omitempty" json:"option_major,omitempty"` CopyrightStatement string `xml:"copyright_statement,omitempty" json:"copyright_statement,omitempty"` }
EPrint is the record contated in a EPrints XML document such as they used to store revisions.
type EPrints ¶ added in v0.0.14
type EPrints struct { XMLName xml.Name `xml:"eprints" json:"-"` XMLNS string `xml:"xmlns,attr,omitempty" json:"xmlns,omitempty"` EPrint []*EPrint `xml:"eprint" json:"eprint"` }
EPrints is the high level XML you get from the REST API. E.g. curl -L -O https://eprints3.example.org/rest/eprint/1234.xml Then parse the 1234.xml document stucture.
type EPrintsAPI ¶
type EPrintsAPI struct { XMLName xml.Name `json:"-"` // EP_EPRINT_URL URL *url.URL `xml:"epgo>eprint_url" json:"eprint_url"` // EP_DATASET Dataset string `xml:"epgo>dataset" json:"dataset"` // EP_AUTH_METHOD AuthType int // EP_USERNAME Username string // EP_PASSWORD Secret string // SuppressNote suppresses the Note field SuppressNote bool }
EPrintsAPI holds the basic connectin information to read the REST API for EPrints
func New ¶
func New(eprintURL, datasetName string, suppressNote bool, authMethod, userName, userSecret string) (*EPrintsAPI, error)
New creates a new API instance
func (*EPrintsAPI) GetEPrint ¶
func (api *EPrintsAPI) GetEPrint(uri string) (*EPrint, []byte, error)
GetEPrint retrieves an EPrint record via REST API Returns a EPrint structure, the raw XML and an error value.
func (*EPrintsAPI) ListEPrintsURI ¶
func (api *EPrintsAPI) ListEPrintsURI() ([]string, error)
ListEPrintsURI returns a list of eprint record ids from the EPrints REST API
func (*EPrintsAPI) ListModifiedEPrintURI ¶ added in v0.0.14
ListModifiedEPrintURI return a list of modifed EPrint URI (eprint_ids) in start and end times
type EPrintsDataSet ¶ added in v0.0.14
type EPrintsDataSet struct { XMLName xml.Name `xml:"html" json:"-"` Paths []string `xml:"body>ul>li>a,omitempty" json:"paths"` }
EPrintsDataSet is a struct for parsing the HTML page that returns a list of available EPrint IDs with links.
func (EPrintsDataSet) MarshalJSON ¶ added in v0.0.14
func (epds EPrintsDataSet) MarshalJSON() ([]byte, error)
MarshalJSON() renders the EPrintsDataSet HTML/XML as a list of ids
type EditorItemList ¶ added in v0.0.14
type EditorItemList struct { XMLName xml.Name `xml:"editors" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
EditorItemList holds a list of editors
func (*EditorItemList) AddItem ¶ added in v0.0.14
func (editorItemList *EditorItemList) AddItem(item *Item) int
AddItem adds an item to the Editor item list and returns the new count of items
type ErrataItemList ¶ added in v0.0.14
type ErrataItemList struct { XMLName xml.Name `xml:"errata" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ErrataItemList
func (*ErrataItemList) AddItem ¶ added in v0.0.14
func (errataItemList *ErrataItemList) AddItem(item *Item) int
AddItem adds an item to the errata item list and returns the new count of items
type ExhibitorItemList ¶ added in v0.0.14
type ExhibitorItemList struct { XMLName xml.Name `xml:"exhibitors" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ExhibitorItemList
func (*ExhibitorItemList) AddItem ¶ added in v0.0.14
func (exhibitorItemList *ExhibitorItemList) AddItem(item *Item) int
AddItem adds an item to the exhibitor item list and returns the new count of items
type File ¶
type File struct { XMLName xml.Name `json:"-"` ID string `xml:"id,attr" json:"id"` FileID int `xml:"fileid" json:"fileid"` DatasetID string `xml:"datasetid" json:"datasetid"` ObjectID int `xml:"objectid" json:"objectid"` Filename string `xml:"filename" json:"filename"` MimeType string `xml:"mime_type" json:"mime_type"` Hash string `xml:"hash" json:"hash"` HashType string `xml:"hash_type" json:"hash_type"` FileSize int `xml:"filesize" json:"filesize"` MTime string `xml:"mtime" json:"mtime"` URL string `xml:"url" json:"url"` }
File structures in Document
type Funder ¶
type Funder struct { XMLName xml.Name `json:"-"` Agency string `xml:"agency" json:"agency"` GrantNumber string `xml:"grant_number,omitempty" json:"grant_number"` }
Funder is a structure describing a funding source for record
type FunderItemList ¶ added in v0.0.14
type FunderItemList struct { XMLName xml.Name `xml:"funders" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
FunderItemList
func (*FunderItemList) AddItem ¶ added in v0.0.14
func (funderItemList *FunderItemList) AddItem(item *Item) int
AddItem adds an item to the funder item list and returns the new count of items
type FunderList ¶
type FunderList []*Funder
FunderList is an array of pointers to Funder structs
func (FunderList) ToAgencies ¶
func (funders FunderList) ToAgencies() []string
ToAgencies takes an array of pointers to Funders and returns a list of Agency names
func (FunderList) ToGrantNumbers ¶
func (funders FunderList) ToGrantNumbers() []string
ToGrantNumbers takes an array of pointers to Funders and returns a list of Agency names
type GScholarItemList ¶ added in v0.0.14
type GScholarItemList struct { XMLName xml.Name `xml:"gscholar" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
GScholarItemList
func (*GScholarItemList) AddItem ¶ added in v0.0.14
func (gScholarItemList *GScholarItemList) AddItem(item *Item) int
AddItem adds an item to the gScholar item list and returns the new count of items
type Generic ¶ added in v0.0.14
type Generic struct { XMLName xml.Name EPrints *EPrints `xml:"eprints,omitempty" json:"eprints,omitempty"` EPrint *EPrint `xml:"eprint,omitempty" json:"eprint,omitempty"` Documents []*Document `xml:"document,omitempty" json:"documents,omitempty"` Files []*File `xml:"file,omitempty" json:"files,omitempty"` Items []*Item `xml:"item" json:"items,omitempty"` Value string `xml:",chardata" json:"value,omitempty"` }
Generic attempts to parse a generic XML fragment into an array of JSON items
func (*Generic) MarshalJSON ¶ added in v0.0.14
MarshalJSON() normalizes Generic into a sensible JSON structure
type Item ¶ added in v0.0.14
type Item struct { XMLName xml.Name `xml:"item" json:"-"` Name *Name `xml:"name,omitempty" json:"name,omitempty"` ID string `xml:"id,omitempty" json:"id,omitempty"` EMail string `xml:"email,omitempty" json:"email,omitempty"` ShowEMail string `xml:"show_email,omitempty" json:"show_email,omitempty"` Role string `xml:"role,omitempty" json:"role,omitempty"` URL string `xml:"url,omitempty" json:"url,omitempty"` Type string `xml:"type,omitempty" json:"type,omitempty"` Description string `xml:"description,omitempty" json:"description,omitempty"` Agency string `xml:"agency,omitempty" json:"agency,omitempty"` GrantNumber string `xml:"grant_number,omitempty" json:"grant_number,omitempty"` URI string `xml:"uri,omitempty" json:"uri,omitempty"` ORCID string `xml:"orcid,omitempty" json:"orcid,omitempty"` Value string `xml:",chardata" json:"value,omitempty"` }
Item is a generic type used by various fields (e.g. Creator, Division, OptionMajor)
func (*Item) MarshalJSON ¶ added in v0.0.14
MarshalJSON() is a custom JSON marshaler for Item
type ItemIssueItemList ¶ added in v0.0.14
type ItemIssueItemList struct { XMLName xml.Name `xml:"item_issues" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ItemIssueItemList
func (*ItemIssueItemList) AddItem ¶ added in v0.0.14
func (issueItemList *ItemIssueItemList) AddItem(item *Item) int
AddItem adds an item to the issue item list and returns the new count of items
type ItemList ¶ added in v0.0.14
type ItemList []*Item
ItemList holds an array of items (e.g. creators, related urls, etc)
type LearningLevelItemList ¶ added in v0.0.14
type LearningLevelItemList struct { XMLName xml.Name `xml:"learning_level" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
LearningLevelItemList
func (*LearningLevelItemList) AddItem ¶ added in v0.0.14
func (learningLevelItemList *LearningLevelItemList) AddItem(item *Item) int
AddItem adds an item to the learningLevel item list and returns the new count of items
type LocalGroupItemList ¶ added in v0.0.14
type LocalGroupItemList struct { XMLName xml.Name `xml:"local_group" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
LocalGroupItemList holds the related URLs (e.g. doi, aux material doi)
func (*LocalGroupItemList) AddItem ¶ added in v0.0.14
func (localGroupItemList *LocalGroupItemList) AddItem(item *Item) int
AddItem adds an item to the local group item list and returns the new count of items
type LyricistItemList ¶ added in v0.0.14
type LyricistItemList struct { XMLName xml.Name `xml:"lyricists" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
LyricistItemList
func (*LyricistItemList) AddItem ¶ added in v0.0.14
func (lyricistItemList *LyricistItemList) AddItem(item *Item) int
AddItem adds an item to the lyricist item list and returns the new count of items
type Name ¶ added in v0.0.14
type Name struct { XMLName xml.Name `json:"-"` Family string `xml:"family,omitempty" json:"family,omitempty"` Given string `xml:"given,omitempty" json:"given,omitempty"` ID string `xml:"id,omitempty" json:"id,omitempty"` Value string `xml:",chardata" json:"value,omitempty"` }
Name handles the "name" types found in Items.
func (*Name) MarshalJSON ¶ added in v0.0.14
MarshalJSON() is a custom JSON marshaler for Name
type NumberingSystem ¶
type NumberingSystem struct { XMLName xml.Name `json:"-"` Name string `xml:"name" json:"name"` ID string `xml:"id" json:"id"` }
NumberingSystem is a structure describing other numbering systems for record
type OptionMajorItemList ¶ added in v0.0.14
type OptionMajorItemList struct { XMLName xml.Name `xml:"option_major" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
OptionMajorItemList
func (*OptionMajorItemList) AddItem ¶ added in v0.0.14
func (optionMajorItemList *OptionMajorItemList) AddItem(item *Item) int
AddItem adds an item to the option major item list and returns the new count of items
type OtherNumberingSystemItemList ¶ added in v0.0.14
type OtherNumberingSystemItemList struct { XMLName xml.Name `xml:"other_numbering_system" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
OtherNumberingSystemItemList
func (*OtherNumberingSystemItemList) AddItem ¶ added in v0.0.14
func (otherNumberingSystemItemList *OtherNumberingSystemItemList) AddItem(item *Item) int
AddItem adds an item to the other numbering system item list and returns the new count of items
type PatentAssigneeItemList ¶ added in v0.0.14
type PatentAssigneeItemList struct { XMLName xml.Name `xml:"patent_assignee" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
PatentAssigneeItemList
func (*PatentAssigneeItemList) AddItem ¶ added in v0.0.14
func (patentAssigneeItemList *PatentAssigneeItemList) AddItem(item *Item) int
AddItem adds an item to the patent assignee item list and returns the new count of items
type PatentClassificationItemList ¶ added in v0.0.14
type PatentClassificationItemList struct { XMLName xml.Name `xml:"patent_classification" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
PatentClassificationItemList
func (*PatentClassificationItemList) AddItem ¶ added in v0.0.14
func (patentClassificationItemList *PatentClassificationItemList) AddItem(item *Item) int
AddItem adds an item to the patent classification item list and returns the new count of items
type Person ¶
type Person struct { XMLName xml.Name `json:"-"` Given string `xml:"name>given" json:"given"` Family string `xml:"name>family" json:"family"` ID string `xml:"id,omitempty" json:"id"` // Customizations for Caltech Library ORCID string `xml:"orcid,omitempty" json:"orcid,omitempty"` //EMail string `xml:"email,omitempty" json:"email,omitempty"` Role string `xml:"role,omitempty" json:"role,omitempty"` }
Person returns the contents of eprint>creators>item>name as a struct
type PersonList ¶
type PersonList []*Person
PersonList is an array of pointers to Person structs
func (PersonList) ToNames ¶
func (persons PersonList) ToNames() []string
ToNames takes an array of pointers to Person and returns a list of names (family, given)
func (PersonList) ToORCIDs ¶
func (persons PersonList) ToORCIDs() []string
ToORCIDs takes an an array of pointers to Person and returns a list of ORCID ids
type ProducerItemList ¶ added in v0.0.14
type ProducerItemList struct { XMLName xml.Name `xml:"producers" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ProducerItemList
func (*ProducerItemList) AddItem ¶ added in v0.0.14
func (producerItemList *ProducerItemList) AddItem(item *Item) int
AddItem adds an item to the producer item list and returns the new count of items
type ProjectItemList ¶ added in v0.0.14
type ProjectItemList struct { XMLName xml.Name `xml:"projects" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ProjectItemList
func (*ProjectItemList) AddItem ¶ added in v0.0.14
func (projectItemList *ProjectItemList) AddItem(item *Item) int
AddItem adds an item to the project item list and returns the new count of items
type ReferenceItemList ¶ added in v0.0.14
type ReferenceItemList struct { XMLName xml.Name `xml:"reference" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ReferenceItemList
func (*ReferenceItemList) AddItem ¶ added in v0.0.14
func (referenceItemList *ReferenceItemList) AddItem(item *Item) int
AddItem adds an item to the reference item list and returns the new count of items
type ReferenceTextItemList ¶ added in v0.0.14
type ReferenceTextItemList struct { XMLName xml.Name `xml:"referencetext" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ReferenceTextItemList
func (*ReferenceTextItemList) AddItem ¶ added in v0.0.14
func (referenceTextItemList *ReferenceTextItemList) AddItem(item *Item) int
AddItem adds an item to the reference text url item list and returns the new count of items
type RelatedPatentItemList ¶ added in v0.0.14
type RelatedPatentItemList struct { XMLName xml.Name `xml:"related_patents" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
RelatedPatentItemList
func (*RelatedPatentItemList) AddItem ¶ added in v0.0.14
func (relatedPatentItemList *RelatedPatentItemList) AddItem(item *Item) int
AddItem adds an item to the related patent item list and returns the new count of items
type RelatedURL ¶
type RelatedURL struct { XMLName xml.Name `json:"-"` URL string `xml:"url" json:"url"` Type string `xml:"type" json:"type"` Description string `xml:"description" json:"description"` }
RelatedURL is a structure containing information about a relationship
type RelatedURLItemList ¶ added in v0.0.14
type RelatedURLItemList struct { XMLName xml.Name `xml:"related_url" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
RelatedURLItemList holds the related URLs (e.g. doi, aux material doi)
func (*RelatedURLItemList) AddItem ¶ added in v0.0.14
func (relatedURLItemList *RelatedURLItemList) AddItem(item *Item) int
AddItem adds an item to the related url item list and returns the new count of items
type ShelfItemList ¶ added in v0.0.14
type ShelfItemList struct { XMLName xml.Name `xml:"shelves" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ShelfItemList
func (*ShelfItemList) AddItem ¶ added in v0.0.14
func (shelfItemList *ShelfItemList) AddItem(item *Item) int
AddItem adds an item to the shelf item list and returns the new count of items
type SkillAreaItemList ¶ added in v0.0.14
type SkillAreaItemList struct { XMLName xml.Name `xml:"skill_areas" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
SkillAreaItemList
func (*SkillAreaItemList) AddItem ¶ added in v0.0.14
func (skillAreaItemList *SkillAreaItemList) AddItem(item *Item) int
AddItem adds an item to the skillArea item list and returns the new count of items
type SubjectItemList ¶ added in v0.0.14
type SubjectItemList struct { XMLName xml.Name `xml:"subjects" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
SubjectItemList
func (*SubjectItemList) AddItem ¶ added in v0.0.14
func (subjectItemList *SubjectItemList) AddItem(item *Item) int
AddItem adds an item to the subject item list and returns the new count of items
type ThesisAdvisorItemList ¶ added in v0.0.14
type ThesisAdvisorItemList struct { XMLName xml.Name `xml:"thesis_advisor" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ThesisAdvisorItemList
func (*ThesisAdvisorItemList) AddItem ¶ added in v0.0.14
func (thesisAdvisorItemList *ThesisAdvisorItemList) AddItem(item *Item) int
AddItem adds an item to the thesis advisor item list and returns the new count of items
type ThesisCommitteeItemList ¶ added in v0.0.14
type ThesisCommitteeItemList struct { XMLName xml.Name `xml:"thesis_committee" json:"-"` Items []*Item `xml:"item,omitempty" json:"item,omitempty"` }
ThesisCommitteeItemList
func (*ThesisCommitteeItemList) AddItem ¶ added in v0.0.14
func (thesisCommitteeItemList *ThesisCommitteeItemList) AddItem(item *Item) int
AddItem adds an item to the thesis committee item list and returns the new count of items
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
ep
command
epharvest is an eprinttools based cli for harvesting EPrints content into a dataset collection.
|
epharvest is an eprinttools based cli for harvesting EPrints content into a dataset collection. |
eputil
command
eputil is a command line tool for interacting with the EPrints REST API.
|
eputil is a command line tool for interacting with the EPrints REST API. |
Package eprinttools is a collection of structures and functions for working with the E-Prints REST API @author R. S. Doiel, <rsdoiel@caltech.edu> Copyright (c) 2017, Caltech All rights not granted herein are expressly reserved by Caltech.
|
Package eprinttools is a collection of structures and functions for working with the E-Prints REST API @author R. S. Doiel, <rsdoiel@caltech.edu> Copyright (c) 2017, Caltech All rights not granted herein are expressly reserved by Caltech. |
py/libeprinttools.go implements a C shared library for implementing a eprinttools module in Python3 Authors R. S. Doiel, <rsdoiel@library.caltech.edu> Copyright (c) 2018, Caltech All rights not granted herein are expressly reserved by Caltech.
|
py/libeprinttools.go implements a C shared library for implementing a eprinttools module in Python3 Authors R. S. Doiel, <rsdoiel@library.caltech.edu> Copyright (c) 2018, Caltech All rights not granted herein are expressly reserved by Caltech. |