Documentation
¶
Index ¶
Constants ¶
View Source
const MaxMessageLength = 1024 * 1024 * 1024 // 1 GiB. This must be smaller than INT32_MAX
View Source
const MaxStreamNameLength = 256
View Source
const MaxStreamsPerPeer = 2_000
Variables ¶
This section is empty.
Functions ¶
func Ed25519PublicKeyFromPeerPublicKey ¶
func Ed25519PublicKeyFromPeerPublicKey(pk PeerPublicKey) ed25519.PublicKey
Types ¶
type Address ¶
type Address string
Address represents a network address & port such as "192.168.1.2:8080". It can also contain special bind addresses such as "0.0.0.0:80".
type PeerID ¶
type PeerID [ed25519.PublicKeySize]byte
PeerID represents a unique identifier for another peer.
func PeerIDFromKeyring ¶
func PeerIDFromKeyring(keyring PeerKeyring) PeerID
func PeerIDFromPeerPublicKey ¶
func PeerIDFromPeerPublicKey(pk PeerPublicKey) PeerID
func PeerIDFromPrivateKey ¶
func PeerIDFromPrivateKey(sk ed25519.PrivateKey) (PeerID, error)
func (PeerID) MarshalBinary ¶
func (PeerID) MarshalText ¶
func (*PeerID) UnmarshalBinary ¶
func (*PeerID) UnmarshalText ¶
type PeerKeyring ¶
type PeerKeyring interface {
// Sign returns an EdDSA-Ed25519 signature on msg produced using the
// standard library's ed25519.Sign function. Must be fast.
Sign(msg []byte) (signature []byte, err error)
// PublicKey returns the public component of the keypair used in Sign.
PublicKey() PeerPublicKey
}
type PeerPublicKey ¶
type PeerPublicKey [ed25519.PublicKeySize]byte
PeerPublicKey is the public key used to cryptographically identify an oracle in p2p related communications and peer discovery.
func MustPeerPublicKeyFromGenericPublicKey ¶
func MustPeerPublicKeyFromGenericPublicKey(publickey crypto.PublicKey) PeerPublicKey
func PeerPublicKeyFromGenericPublicKey ¶
func PeerPublicKeyFromGenericPublicKey(publickey crypto.PublicKey) (PeerPublicKey, error)
type TokenBucketParams ¶
TokenBucketParams contains the two parameters for a token bucket rate limiter.
Click to show internal directories.
Click to hide internal directories.