Documentation ¶
Index ¶
- Constants
- Variables
- type Multiaddr
- func (m *Multiaddr) Decapsulate(o *Multiaddr) (*Multiaddr, error)
- func (m *Multiaddr) DialArgs() (string, string, error)
- func (m *Multiaddr) Encapsulate(o *Multiaddr) *Multiaddr
- func (m *Multiaddr) Equal(m2 *Multiaddr) bool
- func (m *Multiaddr) IsThinWaist() bool
- func (m *Multiaddr) Protocols() (ret []*Protocol, err error)
- func (m *Multiaddr) String() (string, error)
- type Protocol
Constants ¶
const ( P_IP4 = 4 P_TCP = 6 P_UDP = 17 P_DCCP = 33 P_IP6 = 41 P_SCTP = 132 )
replicating table here to: 1. avoid parsing the csv 2. ensuring errors in the csv don't screw up code. 3. changing a number has to happen in two places.
Variables ¶
var Protocols = []*Protocol{ &Protocol{P_IP4, 32, "ip4"}, &Protocol{P_TCP, 16, "tcp"}, &Protocol{P_UDP, 16, "udp"}, &Protocol{P_DCCP, 16, "dccp"}, &Protocol{P_IP6, 128, "ip6"}, &Protocol{P_SCTP, 16, "sctp"}, }
Protocols is the list of multiaddr protocols supported by this module.
Functions ¶
This section is empty.
Types ¶
type Multiaddr ¶
type Multiaddr struct {
Bytes []byte
}
Multiaddr is the data structure representing a multiaddr
func FromNetAddr ¶
FromNetAddr converts a net.Addr type to a Multiaddr.
func NewMultiaddr ¶
NewMultiaddr parses and validates an input string, returning a *Multiaddr
func (*Multiaddr) Decapsulate ¶
Decapsulate unwraps Multiaddr up until the given Multiaddr is found.
func (*Multiaddr) DialArgs ¶
DialArgs is a convenience function returning arguments for use in net.Dial
func (*Multiaddr) Encapsulate ¶
Encapsulate wraps a given Multiaddr, returning the resulting joined Multiaddr
func (*Multiaddr) IsThinWaist ¶
IsThinWaist returns whether this multiaddr includes "Thin Waist" Protocols. This means: /{IP4, IP6}/{TCP, UDP}
type Protocol ¶
Protocol is a Multiaddr protocol description structure.
func ProtocolWithCode ¶
ProtocolWithCode returns the Protocol description with given protocol code.
func ProtocolWithName ¶
ProtocolWithName returns the Protocol description with given string name.