fetcher

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package fetcher implements path segment fetching, verification and combination logic for SCIOND.

Index

Constants

View Source
const (
	DefaultMinWorkerLifetime = 10 * time.Second
)

Variables

This section is empty.

Functions

func NewExtendedContext

func NewExtendedContext(refCtx context.Context,
	minLifetime time.Duration) (context.Context, context.CancelFunc)

NewExtendedContext returns a new _independent_ context that can extend past refCtx's lifetime, guaranteeing a minimum lifetime of minLifetime. If refCtx has a deadline, the newly created context will have a deadline equal to the maximum of refCtx's deadline and (minLifetime + currentTime). If refCtx does not have a deadline, the function panics.

Because the returned context is independent, calling refCtx's cancellation function will not result in the cancellation of the returned context.

Types

type Fetcher

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

func NewFetcher

func NewFetcher(topo *topology.Topo, messenger infra.Messenger, pathDB *pathdb.DB,
	trustStore infra.TrustStore, revCache revcache.RevCache, logger log.Logger) *Fetcher

func (*Fetcher) GetPaths

func (f *Fetcher) GetPaths(ctx context.Context, req *sciond.PathReq,
	earlyReplyInterval time.Duration) (*sciond.PathReply, error)

GetPaths fulfills the path request described by req. GetPaths will attempt to build paths at start, after earlyReplyInterval and at context expiration (or whenever all background workers return). An earlyReplyInterval of 0 means no early reply attempt is made.

Jump to

Keyboard shortcuts

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