types

package
v0.0.0-...-babe0ec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 6 Imported by: 37

Documentation

Index

Constants

This section is empty.

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 PeerIDFromPublicKey

func PeerIDFromPublicKey(pk ed25519.PublicKey) (PeerID, error)

func (PeerID) MarshalBinary

func (p PeerID) MarshalBinary() (data []byte, err error)

func (PeerID) MarshalText

func (p PeerID) MarshalText() (text []byte, err error)

func (PeerID) String

func (p PeerID) String() string

func (*PeerID) UnmarshalBinary

func (p *PeerID) UnmarshalBinary(data []byte) error

func (*PeerID) UnmarshalText

func (p *PeerID) UnmarshalText(text []byte) error

type PeerInfo

type PeerInfo struct {
	ID    PeerID
	Addrs []Address
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL