Documentation ¶
Index ¶
- Constants
- type BitswapPayload
- type CID
- type Duration
- type Multiaddr
- type ProviderResponse
- type ReadBitswapProviderRecord
- type ReadProviderRecord
- type ReadProvidersResponse
- type Time
- type UnknownProviderRecord
- func (u *UnknownProviderRecord) GetProtocol() string
- func (u *UnknownProviderRecord) GetSchema() string
- func (u *UnknownProviderRecord) IsReadProviderRecord()
- func (u UnknownProviderRecord) IsWriteProviderRecord()
- func (u UnknownProviderRecord) MarshalJSON() ([]byte, error)
- func (u *UnknownProviderRecord) UnmarshalJSON(b []byte) error
- type WriteBitswapProviderRecord
- func (p *WriteBitswapProviderRecord) IsSigned() bool
- func (*WriteBitswapProviderRecord) IsWriteProviderRecord()
- func (p *WriteBitswapProviderRecord) Sign(peerID peer.ID, key crypto.PrivKey) error
- func (p *WriteBitswapProviderRecord) UnmarshalJSON(b []byte) error
- func (p *WriteBitswapProviderRecord) Verify() error
- type WriteBitswapProviderRecordResponse
- type WriteProviderRecord
- type WriteProvidersRequest
- type WriteProvidersResponse
Constants ¶
const SchemaBitswap = "bitswap"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitswapPayload ¶
type ProviderResponse ¶
ProviderResponse is implemented for any ProviderResponse. It needs to have a Protocol field.
type ReadBitswapProviderRecord ¶
type ReadBitswapProviderRecord struct { Protocol string Schema string ID *peer.ID Addrs []Multiaddr }
ReadBitswapProviderRecord is a provider result with parameters for bitswap providers
func (*ReadBitswapProviderRecord) GetProtocol ¶
func (rbpr *ReadBitswapProviderRecord) GetProtocol() string
func (*ReadBitswapProviderRecord) GetSchema ¶
func (rbpr *ReadBitswapProviderRecord) GetSchema() string
func (*ReadBitswapProviderRecord) IsReadProviderRecord ¶
func (*ReadBitswapProviderRecord) IsReadProviderRecord()
type ReadProviderRecord ¶
type ReadProviderRecord interface {
IsReadProviderRecord()
}
ReadProviderRecord is a type that enforces structs to imlement it to avoid confusion
type ReadProvidersResponse ¶
type ReadProvidersResponse struct {
Providers []ProviderResponse
}
ReadProvidersResponse is the result of a Provide request
func (*ReadProvidersResponse) UnmarshalJSON ¶
func (r *ReadProvidersResponse) UnmarshalJSON(b []byte) error
type UnknownProviderRecord ¶
UnknownProviderRecord is used when we cannot parse the provider record using `GetProtocol`
func (*UnknownProviderRecord) GetProtocol ¶
func (u *UnknownProviderRecord) GetProtocol() string
func (*UnknownProviderRecord) GetSchema ¶
func (u *UnknownProviderRecord) GetSchema() string
func (*UnknownProviderRecord) IsReadProviderRecord ¶
func (u *UnknownProviderRecord) IsReadProviderRecord()
func (UnknownProviderRecord) IsWriteProviderRecord ¶
func (u UnknownProviderRecord) IsWriteProviderRecord()
func (UnknownProviderRecord) MarshalJSON ¶
func (u UnknownProviderRecord) MarshalJSON() ([]byte, error)
func (*UnknownProviderRecord) UnmarshalJSON ¶
func (u *UnknownProviderRecord) UnmarshalJSON(b []byte) error
type WriteBitswapProviderRecord ¶
type WriteBitswapProviderRecord struct { Protocol string Schema 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:"-"` }
WriteBitswapProviderRecord is used when we want to add a new provider record that is using bitswap.
func (*WriteBitswapProviderRecord) IsSigned ¶
func (p *WriteBitswapProviderRecord) IsSigned() bool
func (*WriteBitswapProviderRecord) IsWriteProviderRecord ¶
func (*WriteBitswapProviderRecord) IsWriteProviderRecord()
func (*WriteBitswapProviderRecord) UnmarshalJSON ¶
func (p *WriteBitswapProviderRecord) UnmarshalJSON(b []byte) error
func (*WriteBitswapProviderRecord) Verify ¶
func (p *WriteBitswapProviderRecord) Verify() error
type WriteBitswapProviderRecordResponse ¶
type WriteBitswapProviderRecordResponse struct { Protocol string Schema string AdvisoryTTL *Duration }
WriteBitswapProviderRecordResponse will be returned as a result of WriteBitswapProviderRecord
func (*WriteBitswapProviderRecordResponse) GetProtocol ¶
func (wbprr *WriteBitswapProviderRecordResponse) GetProtocol() string
func (*WriteBitswapProviderRecordResponse) GetSchema ¶
func (wbprr *WriteBitswapProviderRecordResponse) GetSchema() string
type WriteProviderRecord ¶
type WriteProviderRecord interface {
IsWriteProviderRecord()
}
WriteProviderRecord is a type that enforces structs to imlement it to avoid confusion
type WriteProvidersRequest ¶
type WriteProvidersRequest struct {
Providers []WriteProviderRecord
}
func (*WriteProvidersRequest) UnmarshalJSON ¶
func (r *WriteProvidersRequest) UnmarshalJSON(b []byte) error
type WriteProvidersResponse ¶
type WriteProvidersResponse struct {
ProvideResults []ProviderResponse
}
WriteProvidersResponse is the result of a Provide operation
func (*WriteProvidersResponse) UnmarshalJSON ¶
func (r *WriteProvidersResponse) UnmarshalJSON(b []byte) error