Documentation ¶
Index ¶
- Constants
- Variables
- type Option
- type Publisher
- func (p *Publisher) Addrs() []multiaddr.Multiaddr
- func (p *Publisher) AnnounceHead(ctx context.Context) error
- func (p *Publisher) AnnounceHeadWithAddrs(ctx context.Context, addrs []multiaddr.Multiaddr) error
- func (p *Publisher) Close() error
- func (p *Publisher) ID() peer.ID
- func (p *Publisher) Protocol() int
- func (p *Publisher) SetRoot(ctx context.Context, c cid.Cid) error
- func (p *Publisher) UpdateRoot(ctx context.Context, c cid.Cid) error
- func (p *Publisher) UpdateRootWithAddrs(ctx context.Context, c cid.Cid, addrs []multiaddr.Multiaddr) error
- 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 ¶
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 WithAnnounceSenders ¶
WithAnnounceSenders sets announce.Senders to use for sending announcements.
func WithExtraData ¶
WithExtraData sets the extra data to include in the pubsub message.
func WithMaxGraphsyncRequests ¶ added in v0.0.9
type Publisher ¶ added in v0.0.5
type Publisher struct {
// contains filtered or unexported fields
}
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) AnnounceHead ¶ added in v0.0.5
func (*Publisher) AnnounceHeadWithAddrs ¶ added in v0.0.5
func (*Publisher) UpdateRoot ¶ added in v0.0.5
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.
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 ¶
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