Documentation ¶
Index ¶
- Variables
- 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 Message
- type Option
- type Sync
- type Syncer
- type Voucher
- type VoucherResult
Constants ¶
This section is empty.
Variables ¶
var ErrBadEncoding = errors.New("invalid message encoding")
Functions ¶
Types ¶
type Message ¶
type Message struct { Cid cid.Cid Addrs [][]byte ExtraData []byte // The OrigPeer field may or may not be present in the serialized data, and // the CBOR serializer/deserializer is able to detect that. Only messages // that are re-published by an indexer, for consumption by othen indexers, // contain this field. OrigPeer string }
Message is the payload of a gossip pubsub message.
func (*Message) GetAddrs ¶ added in v0.3.0
GetAddrs reads the slice of Multiaddr that is stored in the Message as a slice of []byte.
type Option ¶
type Option func(*config) error
func AllowPeer ¶ added in v0.3.14
AllowPeer sets the function that determines whether to allow or reject graphsync sessions from a peer.
func WithExtraData ¶ added in v0.2.8
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 ¶ added in v0.2.1
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