Documentation
¶
Index ¶
- Constants
- Variables
- func FetchAndBuildAnnotations(params *FetchAndBuildAnnotationsParams) ([]*models.GOAnnotation, error)
- func FetchPublication(_ context.Context, repo repository.Repository, id string) (*models.Publication, error)
- func GetResp(rawURL string) (*http.Response, error)
- func NewPublication(p *PublicationParams) IOE.IOEither[error, *Publication]
- type FetchAndBuildAnnotationsParams
- type Publication
- type PublicationParams
Constants ¶
View Source
const (
RedisKey = "PUBLICATION_KEY"
)
Variables ¶
View Source
var Status = "published"
Functions ¶
func FetchAndBuildAnnotations ¶
func FetchAndBuildAnnotations( params *FetchAndBuildAnnotationsParams, ) ([]*models.GOAnnotation, error)
func FetchPublication ¶
func FetchPublication( _ context.Context, repo repository.Repository, id string, ) (*models.Publication, error)
FetchPublication fetches a publication by PMID or DOI using Redis caching and the literature NCBI and EuropePMC clients.
func NewPublication ¶ added in v1.47.0
func NewPublication( p *PublicationParams, ) IOE.IOEither[error, *Publication]
NewPublication builds the publication source with both NCBI PubMed and EuropePMC clients.
Types ¶
type FetchAndBuildAnnotationsParams ¶
type FetchAndBuildAnnotationsParams struct {
Ctx context.Context
Gene string
UniprotID string
Redis repository.Repository
Logger *logrus.Entry
}
type Publication ¶
type Publication struct {
// contains filtered or unexported fields
}
Publication resolves PMIDs (NCBI first, EuropePMC fallback) and DOIs (EuropePMC) into GraphQL publication models.
func (*Publication) FetchCachedArticle ¶ added in v1.47.0
func (p *Publication) FetchCachedArticle( repo repository.Repository, id string, ) IOE.IOEither[error, *models.Publication]
FetchCachedArticle normalizes and validates id, checks Redis when repo is non-nil, and fetches from NCBI/EuropePMC on a cache miss.
type PublicationParams ¶ added in v1.47.0
PublicationParams carries optional NCBI and EuropePMC request identity values.
Click to show internal directories.
Click to hide internal directories.