frontend

package
v0.0.0-...-8b501b0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 22 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 {
	// An API for adding links to the link graph.
	GraphAPI GraphAPI

	// An API for executing queries against indexed documents.
	IndexAPI IndexAPI

	// The port to listen for incoming requests.
	ListenAddr string

	// The number of results to display per page. If not specified, a default
	// value of 10 results per page will be used instead.
	ResultsPerPage int

	// The maximum length (in characters) of the highlighted content summary for
	// matching documents. If not specified, a default value of 256 will be used
	// instead.
	MaxSummaryLength int

	// The logger to use. If not defined an output-discarding logger will
	// be used instead.
	Logger *logrus.Entry
}

Config encapsulates the settings for configuring the front-end service.

type GraphAPI

type GraphAPI interface {
	UpsertLink(*graph.Link) error
}

GraphAPI defines as set of API methods for adding links to the link graph.

type IndexAPI

type IndexAPI interface {
	Search(query index.Query) (index.Iterator, error)
}

IndexAPI defines a set of API methods for searching crawled documents.

type Service

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

Service implements the front-end component for the Links 'R' Us project.

func NewService

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

NewService creates a new front-end service instance with the specified config.

func (*Service) Name

func (svc *Service) Name() string

Name implements service.Service

func (*Service) Run

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

Run implements service.Service

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