typehelpers

package
v0.8.25 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdFromLink(t *testing.T, adLink datamodel.Link, lsys ipld.LinkSystem) *schema.Advertisement
func AllAdLinks(t *testing.T, head datamodel.Link, lsys ipld.LinkSystem) []datamodel.Link

AllAdLinks returns a list of all ad cids for a given chain. Latest last

func AllAds

func AllAds(t *testing.T, ad *schema.Advertisement, lsys ipld.LinkSystem) []*schema.Advertisement

func AllMultihashesFromAd

func AllMultihashesFromAd(t *testing.T, ad *schema.Advertisement, lsys ipld.LinkSystem) []multihash.Multihash

func AllMultihashesFromAdChain

func AllMultihashesFromAdChain(t *testing.T, ad *schema.Advertisement, lsys ipld.LinkSystem) []multihash.Multihash

func AllMultihashesFromAdChainDepth

func AllMultihashesFromAdChainDepth(t *testing.T, ad *schema.Advertisement, lsys ipld.LinkSystem, entriesDepth int) []multihash.Multihash
func AllMultihashesFromAdLink(t *testing.T, adLink datamodel.Link, lsys ipld.LinkSystem) []multihash.Multihash

Types

type EntryBuilder

type EntryBuilder interface {
	Build(t *testing.T, lsys ipld.LinkSystem) datamodel.Link
	GetAddrs() []string
}

type RandomAdBuilder

type RandomAdBuilder struct {
	EntryBuilders      []EntryBuilder
	Seed               int64
	AddRmWithNoEntries bool
}

func (RandomAdBuilder) Build

func (b RandomAdBuilder) Build(t *testing.T, lsys ipld.LinkSystem, signingKey crypto.PrivKey) datamodel.Link

func (RandomAdBuilder) BuildWithFakeSig

func (b RandomAdBuilder) BuildWithFakeSig(t *testing.T, lsys ipld.LinkSystem, signingKey crypto.PrivKey) datamodel.Link

type RandomEntryChunkBuilder

type RandomEntryChunkBuilder struct {
	ChunkCount             uint8
	EntriesPerChunk        uint8
	Seed                   int64
	WithInvalidMultihashes bool
	Addrs                  []string
}

func (RandomEntryChunkBuilder) Build

func (b RandomEntryChunkBuilder) Build(t *testing.T, lsys ipld.LinkSystem) datamodel.Link

func (RandomEntryChunkBuilder) GetAddrs added in v0.5.11

func (b RandomEntryChunkBuilder) GetAddrs() []string

type RandomHamtEntryBuilder

type RandomHamtEntryBuilder struct {
	BucketSize             int
	BitWidth               int
	MultihashCount         uint32
	Seed                   int64
	WithInvalidMultihashes bool
	Addrs                  []string
}

func (RandomHamtEntryBuilder) Build

func (b RandomHamtEntryBuilder) Build(t *testing.T, lsys ipld.LinkSystem) datamodel.Link

func (RandomHamtEntryBuilder) GetAddrs added in v0.5.11

func (b RandomHamtEntryBuilder) GetAddrs() []string

Jump to

Keyboard shortcuts

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