ranker

package
v0.0.0-...-e97be17 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GraphAPI GraphAPI
	IndexAPI IndexAPI

	// An API for detecting the partition assignments for this service.
	PartitionDetector partition.Detector

	// A clock instance for generating time-related events. If not specified,
	// the default wall-clock will be used instead.
	Clock clock.Clock

	// The number of workers to spin up for computing PageRank scores. If
	// not specified, a default value of 1 will be used instead.
	ComputeWorkers int

	// The time between subsequent crawler passes.
	UpdateInterval time.Duration

	Logger *logrus.Entry
}

Config encapsulates the settings for configuring the ranker service.

type GraphAPI

type GraphAPI interface {
	Links(fromID, toID uuid.UUID, retrievedBefore time.Time) (graph.LinkIterator, error)
	Edges(fromID, toID uuid.UUID, updatedBefore time.Time) (graph.EdgeIterator, error)
}

type IndexAPI

type IndexAPI interface {
	UpdateScore(linkID uuid.UUID, score float64) error
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements the ranker component for the Links 'R' Us project.

func NewService

func NewService(cfg Config) (*Service, error)

NewService creates a new Ranker service instance with the specified config.

func (*Service) Name

func (svc *Service) Name() string

func (*Service) Run

func (svc *Service) Run(ctx context.Context) error

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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