segverifier

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package segverifier implements primitives for verifying path segments.

A Unit contains a path segment, and all the revocations that reference IFIDs in that path segment.

When a unit is verified, it spawns one goroutine for the path segment's verification. It then collects the results from all workers (forcefully terminating them if the unit's context is Done). A UnitResult object is returned, containing a reference to the Unit itself and a map of errors. The map only contains non-nil errors as values, and the keys are represented by the following:

  • If the path segment verification failed, its error is contained at key -1

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSegment indicates the segment failed to verify.
	ErrSegment = serrors.New("segment verification error")
)

Errors

Functions

func StartVerification added in v0.2.0

func StartVerification(ctx context.Context, verifier infra.Verifier, server net.Addr,
	segMetas []*seg.Meta) (chan UnitResult, int)

StartVerification builds the units for the given segMetas and sRevInfos and spawns verify method on the units. StartVerification returns a channel for the UnitResult and the expected amount of results.

func VerifySegment

func VerifySegment(ctx context.Context, verifier infra.Verifier, server net.Addr,
	segment *seg.PathSegment) error

Types

type ElemResult

type ElemResult struct {
	Index int
	Error error
}

type Unit

type Unit struct {
	SegMeta *seg.Meta
}

Unit contains multiple verification items.

func BuildUnits

func BuildUnits(segMetas []*seg.Meta) []*Unit

BuildUnits constructs one verification unit for each segment, together with its associated revocations.

func (*Unit) Len

func (u *Unit) Len() int

func (*Unit) Verify

func (u *Unit) Verify(ctx context.Context, verifier infra.Verifier,
	server net.Addr, unitResults chan UnitResult)

Verify verifies a single unit, putting the results of verifications on unitResults.

type UnitResult

type UnitResult struct {
	Unit   *Unit
	Errors map[int]error
}

func (*UnitResult) SegError added in v0.2.0

func (r *UnitResult) SegError() error

SegError returns the verification error of the segment or nil if there was none.

Jump to

Keyboard shortcuts

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