targets

package
v1.0.4-0.5.2-debug Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxDelegationHashPrefixBitLen = 32
View Source
const MinDelegationHashPrefixBitLen = 1

Variables

View Source
var ErrTopLevelTargetsRoleMissing = errors.New("tuf: top level targets role missing from top level keys DB")

Functions

func NewDelegationsIterator

func NewDelegationsIterator(target string, topLevelKeysDB *verify.DB) (*delegationsIterator, error)

NewDelegationsIterator initialises an iterator with a first step on top level targets.

Types

type Delegation

type Delegation struct {
	Delegator string
	Delegatee data.DelegatedRole
	DB        *verify.DB
}

type HashBin

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

HashBin represents a hex prefix range. First should be less than Last.

func (*HashBin) HashPrefixes

func (b *HashBin) HashPrefixes() []string

HashPrefixes returns a slice of all hash prefixes in the bin.

func (*HashBin) RoleName

func (b *HashBin) RoleName() string

RoleName returns the name of the role that signs for the HashBin.

type HashBins

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

HashBins represents an ordered list of hash bin target roles, which together partition the space of target path hashes equal-sized buckets based on path has prefix.

func NewHashBins

func NewHashBins(rolePrefix string, bitLen int) (*HashBins, error)

NewHashBins creates a HashBins partitioning with 2^bitLen buckets.

func (*HashBins) GetBin

func (hb *HashBins) GetBin(i uint64) *HashBin

GetBin returns the HashBin at index i, or nil if i is out of bounds.

func (*HashBins) NumBins

func (hb *HashBins) NumBins() uint64

NumBins returns the number of hash bin partitions.

Jump to

Keyboard shortcuts

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