package worker

Import Path
	golang.org/x/pkgsite/internal/worker (on go.dev)

Dependency Relation
	imports 42 packages, and imported by one package

Involved Source Files fetch.go memory.go metrics.go pages.go Package worker provides functionality for running a worker service. Its primary operation is to fetch modules from a proxy and write them to the database.
Package-Level Type Names (total 8, in which 3 are exported)
/* sort exporteds by: | */
A Fetcher holds state for fetching modules. Cache *cache.Cache DB *postgres.DB ProxyClient *proxy.Client SourceClient *source.Client FetchAndUpdateLatest fetches information about the latest versions from the proxy, and updates the database if the version has changed. It returns the most recent good information, which may be what it just fetched or may be what is already in the DB. It does not update the latest good version; that happens inside InsertModule, because it must be protected by the module-path advisory lock. FetchAndUpdateState fetches and processes a module version, and then updates the module_version_states table according to the result. It returns an HTTP status code representing the result of the fetch operation, and a non-nil error if this status code is not 200.
Server can be installed to serve the go discovery worker. Install registers server routes using the given handler registration func. func NewServer(cfg *config.Config, scfg ServerConfig) (_ *Server, err error)
ServerConfig contains everything needed by a Server. DB *postgres.DB GetExperiments func() []*internal.Experiment IndexClient *index.Client ProxyClient *proxy.Client Queue queue.Queue RedisCacheClient *redis.Client RedisHAClient *redis.Client ReportingClient *errorreporting.Client SourceClient *source.Client StaticPath template.TrustedSource func NewServer(cfg *config.Config, scfg ServerConfig) (_ *Server, err error)
Package-Level Functions (total 23, in which 1 are exported)
NewServer creates a new Server with the given dependencies.
Package-Level Variables (total 8, in which 3 are exported)
EnqueueResponseCount counts worker enqueue responses by response type.
ProxyRemoved is a set of module@version that have been removed from the proxy, even though they are still in the index.
Package-Level Constants (total 3, none are exported)