Documentation ¶
Index ¶
Constants ¶
const LegsVoucherResultType = datatransfer.TypeIdentifier("LegsVoucherResult")
const LegsVoucherType = datatransfer.TypeIdentifier("LegsVoucher")
Variables ¶
var BindnodeRegistry = bindnoderegistry.NewRegistry()
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*config) error
Option is a function that sets a value in a config.
func WithAllowPeer ¶
WithAllowPeer sets the function that determines whether to allow or reject graphsync sessions from a peer.
func WithMaxGraphsyncRequests ¶ added in v0.0.9
type Publisher ¶ added in v0.0.5
type Publisher struct {
// contains filtered or unexported fields
}
Publisher serves an advertisement over libp2p using data-transfer.
func NewPublisher ¶
func NewPublisher(host host.Host, ds datastore.Batching, lsys ipld.LinkSystem, topicName string, options ...Option) (*Publisher, error)
NewPublisher creates a new dagsync publisher.
func NewPublisherFromExisting ¶
func NewPublisherFromExisting(dtManager dt.Manager, host host.Host, topicName string, lsys ipld.LinkSystem, options ...Option) (*Publisher, error)
NewPublisherFromExisting instantiates publishing on an existing data transfer instance.
func (*Publisher) Addrs ¶ added in v0.0.5
func (p *Publisher) Addrs() []multiaddr.Multiaddr
Addrs returns the multiaddrs of the publisher's host.
type Sync ¶
type Sync struct {
// contains filtered or unexported fields
}
Sync provides sync functionality for use with all datatransfer syncs.
func NewSync ¶
func NewSync(host host.Host, ds datastore.Batching, lsys ipld.LinkSystem, blockHook func(peer.ID, cid.Cid), gsMaxInReq, gsMaxOutReq uint64) (*Sync, error)
NewSync creates a new Sync with its own datatransfer.Manager.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer handles a single sync with a provider.
type Voucher ¶
type Voucher struct {
Head *cid.Cid
}
A Voucher is used to communicate a new DAG head
func VoucherFromNode ¶
reads a voucher from an ipld node
func (*Voucher) AsVoucher ¶
func (v *Voucher) AsVoucher() datatransfer.TypedVoucher
type VoucherResult ¶
type VoucherResult struct {
Code uint64
}
A VoucherResult responds to a voucher
func VoucherResultFromNode ¶
func VoucherResultFromNode(node datamodel.Node) (*VoucherResult, error)
reads a voucher from an ipld node
func (*VoucherResult) AsVoucher ¶
func (vr *VoucherResult) AsVoucher() datatransfer.TypedVoucher
func (*VoucherResult) MarshalCBOR ¶
func (t *VoucherResult) MarshalCBOR(w io.Writer) error
func (*VoucherResult) UnmarshalCBOR ¶
func (t *VoucherResult) UnmarshalCBOR(r io.Reader) error