Documentation
¶
Overview ¶
Package jsonfeed converts JSON Feed metadata to/from the commonmeta metadata format.
Index ¶
- func Fetch(str string) (commonmeta.Data, error)
- func GetContributors(contrib Authors) ([]commonmeta.Contributor, error)
- func GetFundingReferences(content Content) []commonmeta.FundingReference
- func Load(filename string) (commonmeta.Data, error)
- func LoadAll(filename string) ([]commonmeta.Data, error)
- func Read(content Content) (commonmeta.Data, error)
- func ReadAll(content []Content) ([]commonmeta.Data, error)
- type Affiliation
- type Authors
- type Blog
- type Content
- type Funding
- type Reference
- type Relation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fetch ¶ added in v0.2.14
func Fetch(str string) (commonmeta.Data, error)
Fetch fetches JSON Feed metadata and returns Commonmeta metadata.
func GetContributors ¶ added in v0.2.14
func GetContributors(contrib Authors) ([]commonmeta.Contributor, error)
func GetFundingReferences ¶ added in v0.2.14
func GetFundingReferences(content Content) []commonmeta.FundingReference
GetFundingReferences returns the funding references from the JSON Feed metadata. Either provided by the blog metadata or via HasAward relationships
func Load ¶ added in v0.2.14
func Load(filename string) (commonmeta.Data, error)
Load loads the metadata for a single work from a JSON file
func LoadAll ¶ added in v0.2.14
func LoadAll(filename string) ([]commonmeta.Data, error)
LoadAll loads the metadata for a list of works from a JSON file and converts it to the Commonmeta format
Types ¶
type Affiliation ¶ added in v0.2.14
Affiliation represents an affiliation in the JSON Feed item.
type Authors ¶ added in v0.2.14
type Authors []struct {
Name string `json:"name"`
URL string `json:"url"`
Affiliation []Affiliation `json:"affiliation"`
}
Authors represents the authors in the JSON Feed item.
type Blog ¶ added in v0.2.14
type Blog struct {
ID string `json:"id"`
Category string `json:"category"`
Description string `json:"description"`
Favicon string `json:"favicon"`
Funding Funding `json:"funding"`
HomePageURL string `json:"home_page_url"`
ISSN string `json:"issn"`
Language string `json:"language"`
License string `json:"license"`
Prefix string `json:"prefix"`
Slug string `json:"slug"`
Title string `json:"title"`
}
type Content ¶
type Content struct {
ID string `json:"id"`
DOI string `json:"doi"`
GUID string `json:"guid"`
Abstract string `json:"abstract"`
ArchiveURL string `json:"archive_url"`
Authors Authors `json:"authors"`
Blog Blog `json:"blog"`
BlogName string `json:"blog_name"`
BlogSlug string `json:"blog_slug"`
Image string `json:"image"`
IndexedAt int64 `json:"indexed_at"`
Language string `json:"language"`
PublishedAt int64 `json:"published_at"`
Relationships []Relation `json:"relationships"`
Reference []Reference `json:"reference"`
Summary string `json:"summary"`
Title string `json:"title"`
UpdatedAt int64 `json:"updated_at"`
URL string `json:"url"`
}
Content represents the JSON Feed metadata.
Click to show internal directories.
Click to hide internal directories.