Documentation ¶
Index ¶
- Constants
- func Handler(event functions.Event, ctx functions.Context) (string, error)
- func JSONAPIError(err error) (string, int, error)
- type Author
- type Cacher
- type EuroPMC
- type Links
- type PubData
- type PubJsonAPI
- type Publication
- type RedisCache
- type RedisReplicationCache
- func (r *RedisReplicationCache) ClearAll(prefix string) error
- func (r *RedisReplicationCache) Delete(key string) error
- func (r *RedisReplicationCache) Get(key string) ([]byte, error)
- func (r *RedisReplicationCache) IsExist(key string) bool
- func (r *RedisReplicationCache) Set(key string, val []byte, t time.Duration) error
Constants ¶
View Source
const REDIS_KEY = "PUBLICATION_KEY"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cacher ¶
type Cacher interface { Get(string) ([]byte, error) Set(string, []byte, time.Duration) error Delete(string) error IsExist(string) bool ClearAll(string) error }
func NewRedisCache ¶
type EuroPMC ¶
type EuroPMC struct { HitCount int64 `json:"hitCount"` NextCursorMark string `json:"nextCursorMark"` Request struct { CursorMark string `json:"cursorMark"` PageSize int64 `json:"pageSize"` Query string `json:"query"` ResultType string `json:"resultType"` Sort string `json:"sort"` Synonym bool `json:"synonym"` } `json:"request"` ResultList struct { Result []struct { AbstractText string `json:"abstractText"` Affiliation string `json:"affiliation"` AuthMan string `json:"authMan"` AuthorList struct { Author []struct { Affiliation string `json:"affiliation"` FirstName string `json:"firstName"` FullName string `json:"fullName"` Initials string `json:"initials"` LastName string `json:"lastName"` } `json:"author"` } `json:"authorList"` AuthorString string `json:"authorString"` CitedByCount int64 `json:"citedByCount"` DateOfCreation string `json:"dateOfCreation"` DateOfRevision string `json:"dateOfRevision"` Doi string `json:"doi"` ElectronicPublicationDate string `json:"electronicPublicationDate"` EpmcAuthMan string `json:"epmcAuthMan"` FirstPublicationDate string `json:"firstPublicationDate"` FullTextURLList struct { FullTextURL []struct { Availability string `json:"availability"` AvailabilityCode string `json:"availabilityCode"` DocumentStyle string `json:"documentStyle"` Site string `json:"site"` URL string `json:"url"` } `json:"fullTextUrl"` } `json:"fullTextUrlList"` HasBook string `json:"hasBook"` HasDBCrossReferences string `json:"hasDbCrossReferences"` HasLabsLinks string `json:"hasLabsLinks"` HasPDF string `json:"hasPDF"` HasReferences string `json:"hasReferences"` HasTMAccessionNumbers string `json:"hasTMAccessionNumbers"` HasTextMinedTerms string `json:"hasTextMinedTerms"` ID string `json:"id"` InEPMC string `json:"inEPMC"` InPMC string `json:"inPMC"` IsOpenAccess string `json:"isOpenAccess"` JournalInfo struct { DateOfPublication string `json:"dateOfPublication"` Journal struct { Essn string `json:"essn"` Isoabbreviation string `json:"isoabbreviation"` Issn string `json:"issn"` MedlineAbbreviation string `json:"medlineAbbreviation"` Nlmid string `json:"nlmid"` Title string `json:"title"` } `json:"journal"` JournalIssueID int64 `json:"journalIssueId"` MonthOfPublication int64 `json:"monthOfPublication"` PrintPublicationDate string `json:"printPublicationDate"` YearOfPublication int64 `json:"yearOfPublication"` Issue string `json:"issue"` Volume string `json:"volume"` } `json:"journalInfo"` KeywordList struct { Keyword []string `json:"keyword"` } `json:"keywordList"` Language string `json:"language"` NihAuthMan string `json:"nihAuthMan"` PageInfo string `json:"pageInfo"` Pmid string `json:"pmid"` PubModel string `json:"pubModel"` PubTypeList struct { PubType []string `json:"pubType"` } `json:"pubTypeList"` PubYear string `json:"pubYear"` Source string `json:"source"` Title string `json:"title"` } `json:"result"` } `json:"resultList"` Version string `json:"version"` }
type PubData ¶
type PubData struct { Type string `json:"type"` ID string `json:"id"` Attributes *Publication `json:"attributes"` }
type PubJsonAPI ¶
type Publication ¶
type Publication struct { Abstract string `json:"abstract"` Doi string `json:"doi,omitempty"` FullTextURL string `json:"full_text_url,omitempty"` PubmedURL string `json:"pubmed_url"` Journal string `json:"journal"` Issn string `json:"issn,omitempty"` Page string `json:"page,omitempty"` Pubmed string `json:"pubmed"` Title string `json:"title"` Source string `json:"source"` Status string `json:"status"` PubType string `json:"pub_type"` Issue string `json:"issue"` Volume string `json:"volume"` JournalIssueId int64 `json:"journalIssueId,omitempty"` PublishedDate string `json:"publication_date"` Authors []*Author `json:"authors"` }
func EuroPMC2Pub ¶
func EuroPMC2Pub(pmc *EuroPMC) *Publication
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func (*RedisCache) ClearAll ¶
func (r *RedisCache) ClearAll(prefix string) error
func (*RedisCache) Delete ¶
func (r *RedisCache) Delete(key string) error
func (*RedisCache) IsExist ¶
func (r *RedisCache) IsExist(key string) bool
type RedisReplicationCache ¶
type RedisReplicationCache struct {
// contains filtered or unexported fields
}
func (*RedisReplicationCache) ClearAll ¶
func (r *RedisReplicationCache) ClearAll(prefix string) error
func (*RedisReplicationCache) Delete ¶
func (r *RedisReplicationCache) Delete(key string) error
func (*RedisReplicationCache) IsExist ¶
func (r *RedisReplicationCache) IsExist(key string) bool
Click to show internal directories.
Click to hide internal directories.