Documentation ¶
Index ¶
- Constants
- Variables
- func NewPublisher(host host.Host, ds datastore.Batching, lsys ipld.LinkSystem, topicName string, ...) (*publisher, error)
- func NewPublisherFromExisting(dtManager dt.Manager, host host.Host, topicName string, lsys ipld.LinkSystem, ...) (*publisher, error)
- type Option
- type Sync
- type Syncer
- type Voucher
- type VoucherResult
Constants ¶
const LegsVoucherResultType = datatransfer.TypeIdentifier("LegsVoucherResult")
const LegsVoucherType = datatransfer.TypeIdentifier("LegsVoucher")
Variables ¶
var BindnodeRegistry = bindnoderegistry.NewRegistry()
Functions ¶
Types ¶
type Option ¶
type Option func(*config) error
Option is a function that sets a value in a config.
func WithAllowPeer ¶ added in v0.5.5
WithAllowPeer sets the function that determines whether to allow or reject graphsync sessions from a peer.
func WithAnnounceSenders ¶ added in v0.5.5
WithAnnounceSenders sets announce.Senders to use for sending announcements.
func WithExtraData ¶
WithExtraData sets the extra data to include in the pubsub message.
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)) (*Sync, error)
NewSync creates a new Sync with its own datatransfer.Manager.
func NewSyncWithDT ¶
func NewSyncWithDT(host host.Host, dtManager dt.Manager, gs graphsync.GraphExchange, ls *ipld.LinkSystem, blockHook func(peer.ID, cid.Cid)) (*Sync, error)
NewSyncWithDT creates a new Sync with a datatransfer.Manager provided by the caller.
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 ¶ added in v0.5.9
reads a voucher from an ipld node
func (*Voucher) AsVoucher ¶ added in v0.5.9
func (v *Voucher) AsVoucher() datatransfer.TypedVoucher
type VoucherResult ¶
type VoucherResult struct {
Code uint64
}
A VoucherResult responds to a voucher
func VoucherResultFromNode ¶ added in v0.5.9
func VoucherResultFromNode(node datamodel.Node) (*VoucherResult, error)
reads a voucher from an ipld node
func (*VoucherResult) AsVoucher ¶ added in v0.5.9
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