Documentation
¶
Index ¶
Constants ¶
View Source
const SchemaBitswap = "bitswap"
Deprecated: use the more versatile SchemaPeer instead. For more information, read IPIP-417.
View Source
const SchemaPeer = "peer"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitswapPayload ¶
type BitswapRecord
deprecated
added in
v0.13.0
type PeerRecord ¶ added in v0.13.0
type PeerRecord struct {
Schema string
ID *peer.ID
Addrs []Multiaddr
Protocols []string
// Extra contains extra fields that were included in the original JSON raw
// message, except for the known ones represented by the remaining fields.
Extra map[string]json.RawMessage
}
func (*PeerRecord) GetSchema ¶ added in v0.13.0
func (pr *PeerRecord) GetSchema() string
func (PeerRecord) MarshalJSON ¶ added in v0.13.0
func (pr PeerRecord) MarshalJSON() ([]byte, error)
func (*PeerRecord) UnmarshalJSON ¶ added in v0.13.0
func (pr *PeerRecord) UnmarshalJSON(b []byte) error
type Record ¶ added in v0.13.0
type Record interface {
GetSchema() string
}
Record is implemented for any record.
type UnknownRecord ¶ added in v0.13.0
type UnknownRecord struct {
Schema string
// Bytes contains the raw JSON bytes that were used to unmarshal this record.
// This value can be used, for example, to unmarshal de record into a different
// type if Schema is of a known value.
Bytes []byte
}
func (*UnknownRecord) GetSchema ¶ added in v0.13.0
func (ur *UnknownRecord) GetSchema() string
func (UnknownRecord) MarshalJSON ¶ added in v0.13.0
func (ur UnknownRecord) MarshalJSON() ([]byte, error)
func (*UnknownRecord) UnmarshalJSON ¶ added in v0.13.0
func (ur *UnknownRecord) UnmarshalJSON(b []byte) error
type WriteBitswapRecord
deprecated
added in
v0.13.0
type WriteBitswapRecord struct {
Schema string
Protocol string
Signature string
// this content must be untouched because it is signed and we need to verify it
RawPayload json.RawMessage `json:"Payload"`
Payload BitswapPayload `json:"-"`
}
Deprecated: protocol-agnostic provide is being worked on in IPIP-378:
func (*WriteBitswapRecord) GetSchema ¶ added in v0.13.0
func (wr *WriteBitswapRecord) GetSchema() string
func (*WriteBitswapRecord) IsSigned ¶ added in v0.13.0
func (p *WriteBitswapRecord) IsSigned() bool
func (*WriteBitswapRecord) UnmarshalJSON ¶ added in v0.13.0
func (p *WriteBitswapRecord) UnmarshalJSON(b []byte) error
func (*WriteBitswapRecord) Verify ¶ added in v0.13.0
func (p *WriteBitswapRecord) Verify() error
type WriteBitswapRecordResponse
deprecated
added in
v0.13.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.