Documentation ¶
Index ¶
- func CreateHostRandom(hostSeq int, ip string, seeds map[peer.ID]ma.Multiaddr, logger api.Logger) (host.Host, peer.ID, ma.Multiaddr, error)
- func CreateHostWithCrypto(hostSeq int, ip string, privateKey crypto.PrivateKey, ...) (host.Host, peer.ID, ma.Multiaddr, error)
- func MakeTlsConfigAndLoadPeerIdFuncWithPrivateKey(privateKey crypto.PrivateKey) (*cmTls.Config, types.LoadPeerIdFromCMTlsCertFunc, error)
- func PeerIdFunction() func(certificates []*cmx509.Certificate) (peer.ID, error)
- func PrivateKeyToCertificate(privateKey crypto.PrivateKey) (*cmTls.Certificate, error)
- func UseGMTls(tlsCertBytes []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHostRandom ¶
func CreateHostRandom( hostSeq int, ip string, seeds map[peer.ID]ma.Multiaddr, logger api.Logger) (host.Host, peer.ID, ma.Multiaddr, error)
CreateHostRandom create a host instance with random crypto. This method only for testing.
func CreateHostWithCrypto ¶
func CreateHostWithCrypto( hostSeq int, ip string, privateKey crypto.PrivateKey, seeds map[peer.ID]ma.Multiaddr, logger api.Logger) (host.Host, peer.ID, ma.Multiaddr, error)
CreateHostWithCrypto create a host instance with quic network type and simple config.
func MakeTlsConfigAndLoadPeerIdFuncWithPrivateKey ¶
func MakeTlsConfigAndLoadPeerIdFuncWithPrivateKey( privateKey crypto.PrivateKey) (*cmTls.Config, types.LoadPeerIdFromCMTlsCertFunc, error)
MakeTlsConfigAndLoadPeerIdFuncWithPrivateKey create a tls config and load peer id function for the host config with private key given.
func PeerIdFunction ¶
func PeerIdFunction() func(certificates []*cmx509.Certificate) (peer.ID, error)
PeerIdFunction is a function can load peer.ID from certificates got when tls handshaking.
func PrivateKeyToCertificate ¶
func PrivateKeyToCertificate(privateKey crypto.PrivateKey) (*cmTls.Certificate, error)
PrivateKeyToCertificate create a certificate simply with a private key.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.