Documentation ¶
Index ¶
- Constants
- func LoadKnownPeers(path string) (peers []string, err error)
- func PrettyId(peerId string) string
- func PrettyIds(peerId []string) string
- type Bytable
- type CryptoType
- type IncomingLetter
- type NewIncomingMessageEventSubscriber
- type NewOutgoingMessageEventSubscriber
- type OutgoingLetter
- type OutgoingMsg
- type PeerConnectedEventSubscriber
- type PeerDisconnectedEventSubscriber
- type PeerEvent
- type RelayableOutgoingMsg
- type SendType
- type TransportAccount
- type WireMessage
Constants ¶
View Source
const CryptoTypeECDSA = CryptoType(cryptopb.KeyType_ECDSA)
View Source
const CryptoTypeEd25519 = CryptoType(cryptopb.KeyType_Ed25519)
View Source
const CryptoTypeRSA = CryptoType(cryptopb.KeyType_RSA)
View Source
const CryptoTypeSecp256k1 = CryptoType(cryptopb.KeyType_Secp256k1)
Variables ¶
This section is empty.
Functions ¶
func LoadKnownPeers ¶
Types ¶
type CryptoType ¶
type CryptoType int
type IncomingLetter ¶
type IncomingLetter struct { Msg *WireMessage From string // peer Id }
func (IncomingLetter) String ¶
func (i IncomingLetter) String() string
type NewIncomingMessageEventSubscriber ¶
type NewIncomingMessageEventSubscriber interface { Name() string NewIncomingMessageEventChannel() chan *IncomingLetter }
type NewOutgoingMessageEventSubscriber ¶
type NewOutgoingMessageEventSubscriber interface { Name() string NewOutgoingMessageEventChannel() chan *OutgoingLetter }
type OutgoingLetter ¶
type OutgoingLetter struct { Msg OutgoingMsg SendType SendType CloseAfterSent bool ExceptMyself bool EndReceivers []string // may be the relayer }
func (OutgoingLetter) String ¶
func (o OutgoingLetter) String() string
type OutgoingMsg ¶
type RelayableOutgoingMsg ¶
type RelayableOutgoingMsg interface { OutgoingMsg GetReceiverId() string // final receiver. GetOriginId() string // original sender }
type TransportAccount ¶
TransportAccount represents a full account of a user in p2p network.
type WireMessage ¶
type WireMessage struct { MsgType int // what ContentByte is. ContentBytes []byte // this Byte will be recovered to implementation of Content interface }
WireMessage is for transportation. msgp WireMessage
func (*WireMessage) DecodeMsg ¶
func (z *WireMessage) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*WireMessage) EncodeMsg ¶
func (z *WireMessage) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*WireMessage) MarshalMsg ¶
func (z *WireMessage) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*WireMessage) Msgsize ¶
func (z *WireMessage) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*WireMessage) UnmarshalMsg ¶
func (z *WireMessage) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
Click to show internal directories.
Click to hide internal directories.