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 ¶
- type AdBuilder
- func (pub *AdBuilder) BuildAndSign() (*schema.Advertisement, error)
- func (pub *AdBuilder) WithContextID(contextID []byte) *AdBuilder
- func (pub *AdBuilder) WithEntries(entries cid.Cid) *AdBuilder
- func (pub *AdBuilder) WithExtendedProviders(eps ...Info) *AdBuilder
- func (pub *AdBuilder) WithLastAdID(lastAdID cid.Cid) *AdBuilder
- func (pub *AdBuilder) WithMetadata(md []byte) *AdBuilder
- func (pub *AdBuilder) WithOverride(override bool) *AdBuilder
- type Info
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 ¶
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 ¶
WithContextID sets contextID
func (*AdBuilder) WithEntries ¶ added in v0.13.3
WithEntries sets the CID of the entries for the ad
func (*AdBuilder) WithExtendedProviders ¶
WithExtendedProviders sets extended providers
func (*AdBuilder) WithLastAdID ¶
WithLastAdID sets last ad cid
func (*AdBuilder) WithMetadata ¶
WithMetadata sets metadata
func (*AdBuilder) WithOverride ¶
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.