Help us shape the future of Go! Take the 2026 Go Developer Survey

fetch

package
v1.47.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: BSD-2-Clause Imports: 25 Imported by: 0

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 GetResp

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

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