Documentation ¶
Index ¶
- func NewPublisher(host host.Host, ds datastore.Batching, lsys ipld.LinkSystem, topic string, ...) (*publisher, error)
- func NewPublisherFromExisting(dtManager dt.Manager, host host.Host, topic string, lsys ipld.LinkSystem, ...) (*publisher, error)
- type Option
- type Sync
- type Syncer
- type Voucher
- type VoucherResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*config) error
func AllowPeer ¶
AllowPeer sets the function that determines whether to allow or reject graphsync sessions from a peer.
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 (*Voucher) Type ¶
func (v *Voucher) Type() datatransfer.TypeIdentifier
Type provides an identifier for the voucher to go-data-transfer
type VoucherResult ¶
type VoucherResult struct {
Code uint64
}
A VoucherResult responds to a voucher
func (*VoucherResult) MarshalCBOR ¶
func (t *VoucherResult) MarshalCBOR(w io.Writer) error
func (*VoucherResult) Type ¶
func (v *VoucherResult) Type() datatransfer.TypeIdentifier
Type provides an identifier for the voucher result to go-data-transfer
func (*VoucherResult) UnmarshalCBOR ¶
func (t *VoucherResult) UnmarshalCBOR(r io.Reader) error