fetch

package
v1.49.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: BSD-2-Clause Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 FetchPublicationIOE added in v1.49.0

func FetchPublicationIOE(
	repo repository.Repository,
	id string,
) IOE.IOEither[error, *models.Publication]

FetchPublicationIOE fetches a publication by PMID or DOI as a lazy IOEither using Redis caching and the literature NCBI and EuropePMC clients.

func GetResp

func GetResp(rawURL string) (*http.Response, error)

func IsResolvableIdentifier added in v1.49.0

func IsResolvableIdentifier(id string) bool

IsResolvableIdentifier reports whether the publication pipeline can resolve the stored identifier: a decimal PMID or a DOI-shaped string after DOI prefix normalization.

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

type PublicationParams struct {
	APIKey string
	Tool   string
	Email  string
}

PublicationParams carries optional NCBI and EuropePMC request identity values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL