Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONMarshal ¶ added in v1.2.4
JSONMarshal provides provide a custom json encoder to solve a an issue with HTML entities getting converted to UTF-8 code points by json.Marshal(), json.MarshalIndent().
func JSONMarshalIndent ¶ added in v1.2.4
JSONMarshalIndent provides provide a custom json encoder to solve a an issue with HTML entities getting converted to UTF-8 code points by json.Marshal(), json.MarshalIndent().
func JSONUnmarshal ¶ added in v1.2.4
JSONUnmarshal is a custom JSON decoder so we can treat numbers easier
Types ¶
type Codemeta ¶
type Codemeta struct { // Terms used by Caltech Library codemeta.json // Id should be the DOI if available Context string `json:"@context"` Type string `json:"@type"` Name string `json:"name"` Description string `json:"description"` CodeRepository string `json:"codeRepository"` IssueTracker string `json:"issueTracker"` License string `json:"license"` Version string `json:"version"` Author []*PersonOrOrganization `json:"author"` Contributor []*PersonOrOrganization `json:"contributor,omitempty"` Editor []*PersonOrOrganization `json:"editor,omitempty"` Maintainer []*PersonOrOrganization `json:"maintainer,omitempty"` DevelopmentStatus string `json:"developmentStatus"` DownloadURL string `json:"downloadUrl"` Keywords []string `json:"keywords"` //Maintainer string `json:"maintainer,omitempty"` //Funder []*PersonOrOrganization `json:"funder,omitempty"` Funder *PersonOrOrganization `json:"funder,omitempty"` CopyrightHolder []*PersonOrOrganization `json:"copyrightHolder,omitempty"` CopyrightYear int `json:"copyrightYear,omitempty"` Created string `json:"dateCreated,omitempty"` Updated string `json:"dateModified,omitempty"` Published string `json:"datePublished,omitempty"` Identifier string `json:"identifier,omitempty"` //FIXME: Is this where I can put the DOI }
func (*Codemeta) Delete ¶ added in v1.0.4
Delete removes the value in the codemeta.json file for a provided json path.
func (*Codemeta) Set ¶ added in v1.0.4
Set sets the value in the codemeta.json file for a provided json path.
func (*Codemeta) Show ¶ added in v1.0.4
Show returns a the value as a string for the json path described by dataPaths. If dataPath is "." return the whole object as a string. if the dataPath is not valid return an empty string.
func (*Codemeta) ToCff ¶
ToCff crosswalks a Codemeta data structure rendering CITATION.cff document as an array of byte. Based on documentation at https://citation-file-format.github.io/
type PersonOrOrganization ¶
type PersonOrOrganization struct { // ORCID is use for person id Id string `json:"@id"` Type string `json:"@type"` // Name is used by organizations Name string `json:"name,omitempty"` // Given/Family are used by individual persons GivenName string `json:"givenName,omitempty"` FamilyName string `json:"familyName,omitempty"` Affiliation *PersonOrOrganization `json:"affiliation,omitempty"` Email string `json:"email,omitempty"` }
func (*PersonOrOrganization) ToCFF ¶
func (person *PersonOrOrganization) ToCFF() ([]byte, error)
func (*PersonOrOrganization) ToJSON ¶
func (person *PersonOrOrganization) ToJSON() ([]byte, error)