xproviders

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0, MIT Imports: 8 Imported by: 1

Documentation

Overview

Package xproviders provides convinience classes for building and signing advertisements with ExtendedProviders, that implement extended providers specification. Built and signed advertisements can be published using Engine.

See: https://github.com/ipni/storetheindex/blob/main/doc/ingest.md#extendedprovider

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdBuilder

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

AdBuilder contains fields required for building and signing of a new ad with Extended Providers

func NewAdBuilder

func NewAdBuilder(providerID peer.ID, privKey crypto.PrivKey, addrs []ma.Multiaddr) *AdBuilder

NewAdBuilder creates a new ExtendedProvidersAdBuilder

func (*AdBuilder) BuildAndSign

func (pub *AdBuilder) BuildAndSign() (*schema.Advertisement, error)

BuildAndSign verifies and signs a new extended provider ad. After that it can be published using engine. Identity of the main provider will be appended to the extended provider list automatically.

func (*AdBuilder) WithContextID

func (pub *AdBuilder) WithContextID(contextID []byte) *AdBuilder

WithContextID sets contextID

func (*AdBuilder) WithEntries added in v0.13.3

func (pub *AdBuilder) WithEntries(entries cid.Cid) *AdBuilder

WithEntries sets the CID of the entries for the ad

func (*AdBuilder) WithExtendedProviders

func (pub *AdBuilder) WithExtendedProviders(eps ...Info) *AdBuilder

WithExtendedProviders sets extended providers

func (*AdBuilder) WithLastAdID

func (pub *AdBuilder) WithLastAdID(lastAdID cid.Cid) *AdBuilder

WithLastAdID sets last ad cid

func (*AdBuilder) WithMetadata

func (pub *AdBuilder) WithMetadata(md []byte) *AdBuilder

WithMetadata sets metadata

func (*AdBuilder) WithOverride

func (pub *AdBuilder) WithOverride(override bool) *AdBuilder

WithOverride sets override

type Info

type Info struct {
	// ID contains peer ID of the extended provider
	ID string
	// Metadata contains optional metadata of the extended provider
	Metadata []byte
	// Addrs contains a list of extended provider's addresses
	Addrs []string
	// Priv contains a provtae key of the extended provider
	Priv crypto.PrivKey
}

Info contains information about extended provider.

func NewInfo

func NewInfo(peerID peer.ID, priv crypto.PrivKey, metadata []byte, addrs []ma.Multiaddr) Info

NewInfo allows to create a new ExtendedProviderInfo providing type safety around its fields

Jump to

Keyboard shortcuts

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