fetcher

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2018 License: Apache-2.0 Imports: 23 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) *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.

type RevCache

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

func NewRevCache

func NewRevCache(defaultExpiration, cleanupInterval time.Duration) *RevCache

func (*RevCache) Add

func (c *RevCache) Add(ia addr.IA, ifid common.IFIDType, rev *path_mgmt.SignedRevInfo,
	ttl time.Duration)

func (*RevCache) Get

func (c *RevCache) Get(ia addr.IA, ifid common.IFIDType) (*path_mgmt.SignedRevInfo, bool)

Jump to

Keyboard shortcuts

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