Documentation ¶
Index ¶
- Constants
- Variables
- func CompoundValue(val map[string]interface{}) (*pb.CompoundValue, error)
- func FilterAddrs(addrs []multiaddr.Multiaddr, predf func(multiaddr.Multiaddr) bool) []multiaddr.Multiaddr
- func FormatHandle(pi p2p_pstore.PeerInfo) string
- func GetPublicIP() (string, error)
- func Hash(data []byte) multihash.Multihash
- func HashFromBytes(hash []byte) multihash.Multihash
- func IsLinkLocalAddr(addr multiaddr.Multiaddr) bool
- func IsLocalhostAddr(addr multiaddr.Multiaddr) bool
- func IsPrivateAddr(addr multiaddr.Multiaddr) bool
- func IsPublicAddr(addr multiaddr.Multiaddr) bool
- func IsRoutableAddr(addr multiaddr.Multiaddr) bool
- func NewHost(ctx context.Context, id PeerIdentity, laddr multiaddr.Multiaddr, ...) (p2p_host.Host, error)
- func PBFromPeerInfo(pbpi *pb.PeerInfo, pinfo p2p_pstore.PeerInfo)
- func PBToPeerInfo(pbpi *pb.PeerInfo) (empty p2p_pstore.PeerInfo, err error)
- func ParseAddress(str string) (multiaddr.Multiaddr, error)
- func ParseHandle(str string) (empty p2p_pstore.PeerInfo, err error)
- func ParseHandleId(str string) (empty p2p_pstore.PeerInfo, err error)
- func PublisherID58(pubk p2p_crypto.PubKey) (string, error)
- func PublisherKey(id58 string) (p2p_crypto.PubKey, error)
- func SimpleValue(val interface{}) (*pb.SimpleValue, error)
- func SimpleValueOf(sv *pb.SimpleValue) (interface{}, error)
- func ValueOf(res *pb.QueryResultValue) (interface{}, error)
- type NATConfig
- type PeerIdentity
- type PublisherIdentity
- type ValueError
Constants ¶
View Source
const ( NATConfigNone = iota NATConfigAuto NATConfigManual )
View Source
const MaxMessageSize = 2 << 20 // 1 MB
View Source
const NATPortMap = p2p_bhost.NATPortMap
re-export this option to avoid basic host interface leakage
Variables ¶
View Source
var (
BadAddressSpec = errors.New("Bad NAT address specification")
)
View Source
var BadHandle = errors.New("Bad handle")
View Source
var IfconfigError = errors.New("ifconfig service error")
Functions ¶
func CompoundValue ¶
func CompoundValue(val map[string]interface{}) (*pb.CompoundValue, error)
func FilterAddrs ¶
func GetPublicIP ¶
func HashFromBytes ¶
func IsLinkLocalAddr ¶
func IsLocalhostAddr ¶
func IsPrivateAddr ¶
func IsPublicAddr ¶
func IsRoutableAddr ¶
func PBFromPeerInfo ¶
func PBFromPeerInfo(pbpi *pb.PeerInfo, pinfo p2p_pstore.PeerInfo)
func PBToPeerInfo ¶
func PBToPeerInfo(pbpi *pb.PeerInfo) (empty p2p_pstore.PeerInfo, err error)
func ParseHandle ¶
func ParseHandle(str string) (empty p2p_pstore.PeerInfo, err error)
parses multiaddr[/p2p]/id (backwards compatible)
func ParseHandleId ¶
func ParseHandleId(str string) (empty p2p_pstore.PeerInfo, err error)
func PublisherID58 ¶
func PublisherID58(pubk p2p_crypto.PubKey) (string, error)
func PublisherKey ¶
func PublisherKey(id58 string) (p2p_crypto.PubKey, error)
func SimpleValue ¶
func SimpleValue(val interface{}) (*pb.SimpleValue, error)
func SimpleValueOf ¶
func SimpleValueOf(sv *pb.SimpleValue) (interface{}, error)
func ValueOf ¶
func ValueOf(res *pb.QueryResultValue) (interface{}, error)
Types ¶
type NATConfig ¶
type NATConfig struct { Opt int // contains filtered or unexported fields }
func NATConfigFromString ¶
func (*NATConfig) PublicAddr ¶
type PeerIdentity ¶
type PeerIdentity struct { ID p2p_peer.ID PrivKey p2p_crypto.PrivKey }
Node identities: PeerIdentity and PublisherIdentity the structs are different because the semantics of id differ PeerIdentities use the raw public key hash as dictated by libp2p
they use RSA keys for interop with js, which is lagging in libp2p-crypto
PublisherIdentities use the base58 encoded public key as identifier
they use ECC (Ed25519) keys and sign statements with them
func MakePeerIdentity ¶
func MakePeerIdentity(home string) (empty PeerIdentity, err error)
Peer Identities
func (PeerIdentity) Pretty ¶
func (id PeerIdentity) Pretty() string
type PublisherIdentity ¶
type PublisherIdentity struct { ID58 string PrivKey p2p_crypto.PrivKey }
func MakePublisherIdentity ¶
func MakePublisherIdentity(home string) (empty PublisherIdentity, err error)
Publisher Identities
func (PublisherIdentity) Pretty ¶
func (id PublisherIdentity) Pretty() string
type ValueError ¶
type ValueError string
func (ValueError) Error ¶
func (v ValueError) Error() string
Click to show internal directories.
Click to hide internal directories.