package multiaddr

Import Path
	github.com/multiformats/go-multiaddr (on go.dev)

Dependency Relation
	imports 22 packages, and imported by 40 packages

Involved Source Files codec.go component.go Package multiaddr provides an implementation of the Multiaddr network address format. Multiaddr emphasizes explicitness, self-description, and portability. It allows applications to treat addresses as opaque tokens, and to avoid making assumptions about the address representation (e.g. length). Learn more at https://github.com/multiformats/multiaddr Basic Use: import ( "bytes" "strings" ma "github.com/multiformats/go-multiaddr" ) // construct from a string (err signals parse failure) m1, err := ma.NewMultiaddr("/ip4/127.0.0.1/udp/1234") // construct from bytes (err signals parse failure) m2, err := ma.NewMultiaddrBytes(m1.Bytes()) // true strings.Equal(m1.String(), "/ip4/127.0.0.1/udp/1234") strings.Equal(m1.String(), m2.String()) bytes.Equal(m1.Bytes(), m2.Bytes()) m1.Equal(m2) m2.Equal(m1) // tunneling (en/decap) printer, _ := ma.NewMultiaddr("/ip4/192.168.0.13/tcp/80") proxy, _ := ma.NewMultiaddr("/ip4/10.20.30.40/tcp/443") printerOverProxy := proxy.Encapsulate(printer) proxyAgain := printerOverProxy.Decapsulate(printer) filter.go meg_capturers.go multiaddr.go protocol.go protocols.go transcoders.go util.go varint.go
Package-Level Type Names (total 7)
/* sort by: | */
Action is an enum modelling all possible filter actions. func (*Filters).ActionForFilter(ipnet net.IPNet) (action Action, ok bool) func (*Filters).AddFilter(ipnet net.IPNet, action Action) func (*Filters).FiltersForAction(action Action) (result []net.IPNet) const ActionAccept const ActionDeny const ActionNone
Component is a single multiaddr Component. (*Component) Bytes() []byte (*Component) Code() int (*Component) Compare(o *Component) int (*Component) Decapsulate(o Multiaddrer) Multiaddr (*Component) Encapsulate(o Multiaddrer) Multiaddr (*Component) Equal(o *Component) bool (*Component) MarshalBinary() ([]byte, error) (*Component) MarshalJSON() ([]byte, error) (*Component) MarshalText() ([]byte, error) (*Component) Multiaddr() Multiaddr (*Component) Protocol() Protocol (*Component) Protocols() []Protocol (*Component) RawValue() []byte (*Component) String() string (*Component) UnmarshalBinary(data []byte) error (*Component) UnmarshalJSON(data []byte) error (*Component) UnmarshalText(data []byte) error (*Component) Value() string (*Component) ValueForProtocol(code int) (string, error) *Component : Multiaddrer *Component : github.com/multiformats/go-multiaddr/x/meg.Matchable *Component : github.com/apache/arrow-go/v18/internal/hashing.ByteSlice *Component : github.com/goccy/go-json.Marshaler *Component : github.com/goccy/go-json.Unmarshaler *Component : encoding.BinaryMarshaler *Component : encoding.BinaryUnmarshaler *Component : encoding.TextMarshaler *Component : encoding.TextUnmarshaler *Component : encoding/json.Marshaler *Component : encoding/json.Unmarshaler *Component : expvar.Var *Component : fmt.Stringer func NewComponent(protocol, value string) (*Component, error) func Split(m Multiaddr) []Component func SplitFirst(m Multiaddr) (*Component, Multiaddr) func SplitLast(m Multiaddr) (Multiaddr, *Component) func (*Component).Compare(o *Component) int func (*Component).Equal(o *Component) bool func Multiaddr.AppendComponent(cs ...*Component) Multiaddr
Filters is a structure representing a collection of accept/deny net.IPNet filters, together with the DefaultAction flag, which represents the default filter policy. Note that the last policy added to the Filters is authoritative. DefaultAction Action (*Filters) ActionForFilter(ipnet net.IPNet) (action Action, ok bool) AddFilter adds a rule to the Filters set, enforcing the desired action for the provided IPNet mask. AddrBlocked parses a ma.Multiaddr and, if a valid netip is found, it applies the Filter set rules, returning true if the given address should be denied, and false if the given address is accepted. If a parsing error occurs, or no filter matches, the Filters' default is returned. TODO: currently, the last filter to match wins always, but it shouldn't be that way. Instead, the highest-specific last filter should win; that way more specific filters override more general ones. FiltersForAction returns the filters associated with the indicated action. RemoveLiteral removes the first filter associated with the supplied IPNet, returning whether something was removed or not. It makes no distinction between whether the rule is an accept or a deny. func NewFilters() *Filters
Multiaddr is the data structure representing a Multiaddr AppendComponent is the same as using `append(m, *c)`, but with a safety check for a nil Component. Bytes returns the []byte representation of this Multiaddr ( Multiaddr) Compare(o Multiaddr) int Decapsulate unwraps Multiaddr up until the given Multiaddr is found. Encapsulate wraps a given Multiaddr, returning the resulting joined Multiaddr Equal tests whether two multiaddrs are equal ( Multiaddr) MarshalBinary() ([]byte, error) ( Multiaddr) MarshalJSON() ([]byte, error) ( Multiaddr) MarshalText() ([]byte, error) ( Multiaddr) Match(p ...meg.Pattern) (bool, error) ( Multiaddr) Multiaddr() Multiaddr Protocols returns the list of protocols this Multiaddr has. will panic in case we access bytes incorrectly. String returns the string representation of a Multiaddr (*Multiaddr) UnmarshalBinary(data []byte) error (*Multiaddr) UnmarshalJSON(data []byte) error (*Multiaddr) UnmarshalText(data []byte) error ( Multiaddr) ValueForProtocol(code int) (value string, err error) Multiaddr : Multiaddrer Multiaddr : github.com/apache/arrow-go/v18/internal/hashing.ByteSlice Multiaddr : github.com/goccy/go-json.Marshaler *Multiaddr : github.com/goccy/go-json.Unmarshaler Multiaddr : encoding.BinaryMarshaler *Multiaddr : encoding.BinaryUnmarshaler Multiaddr : encoding.TextMarshaler *Multiaddr : encoding.TextUnmarshaler Multiaddr : encoding/json.Marshaler *Multiaddr : encoding/json.Unmarshaler Multiaddr : expvar.Var Multiaddr : fmt.Stringer func Cast(b []byte) Multiaddr func FilterAddrs(a []Multiaddr, filters ...func(Multiaddr) bool) []Multiaddr func Join(msInterfaces ...Multiaddrer) Multiaddr func NewMultiaddr(s string) (a Multiaddr, err error) func NewMultiaddrBytes(b []byte) (a Multiaddr, err error) func SplitFirst(m Multiaddr) (*Component, Multiaddr) func SplitFunc(m Multiaddr, cb func(Component) bool) (Multiaddr, Multiaddr) func SplitFunc(m Multiaddr, cb func(Component) bool) (Multiaddr, Multiaddr) func SplitLast(m Multiaddr) (Multiaddr, *Component) func StringCast(s string) Multiaddr func Unique(addrs []Multiaddr) []Multiaddr func (*Component).Decapsulate(o Multiaddrer) Multiaddr func (*Component).Encapsulate(o Multiaddrer) Multiaddr func (*Component).Multiaddr() Multiaddr func Multiaddr.AppendComponent(cs ...*Component) Multiaddr func Multiaddr.Decapsulate(rightPartsAny Multiaddrer) Multiaddr func Multiaddr.Encapsulate(other Multiaddrer) Multiaddr func Multiaddr.Multiaddr() Multiaddr func Multiaddrer.Multiaddr() Multiaddr func github.com/multiformats/go-multiaddr/net.AddrMatch(match Multiaddr, addrs []Multiaddr) []Multiaddr func github.com/multiformats/go-multiaddr/net.FromIP(ip net.IP) (Multiaddr, error) func github.com/multiformats/go-multiaddr/net.FromIPAndZone(ip net.IP, zone string) (Multiaddr, error) func github.com/multiformats/go-multiaddr/net.FromNetAddr(a net.Addr) (Multiaddr, error) func github.com/multiformats/go-multiaddr/net.InterfaceMultiaddrs() ([]Multiaddr, error) func github.com/multiformats/go-multiaddr/net.ResolveUnspecifiedAddress(resolve Multiaddr, ifaceAddrs []Multiaddr) ([]Multiaddr, error) func github.com/multiformats/go-multiaddr/net.ResolveUnspecifiedAddresses(unspecAddrs, ifaceAddrs []Multiaddr) ([]Multiaddr, error) func github.com/multiformats/go-multiaddr/net.(*CodecMap).FromNetAddr(a net.Addr) (Multiaddr, error) func github.com/multiformats/go-multiaddr/net.Conn.LocalMultiaddr() Multiaddr func github.com/multiformats/go-multiaddr/net.Conn.RemoteMultiaddr() Multiaddr func github.com/multiformats/go-multiaddr/net.Listener.Multiaddr() Multiaddr func github.com/multiformats/go-multiaddr/net.PacketConn.LocalMultiaddr() Multiaddr func github.com/multiformats/go-multiaddr/net.PacketConn.ReadFromMultiaddr(b []byte) (int, Multiaddr, error) func github.com/multiformats/go-multiaddr-dns.Resolve(ctx context.Context, maddr Multiaddr) ([]Multiaddr, error) func github.com/multiformats/go-multiaddr-dns.(*Resolver).Resolve(ctx context.Context, maddr Multiaddr) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/core/host.Host.Addrs() []Multiaddr func github.com/libp2p/go-libp2p/core/network.Conn.LocalMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/core/network.Conn.RemoteMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/core/network.ConnMultiaddrs.LocalMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/core/network.ConnMultiaddrs.RemoteMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/core/network.MultiaddrDNSResolver.ResolveDNSAddr(ctx context.Context, expectedPeerID peer.ID, maddr Multiaddr, recursionLimit, outputLimit int) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/core/network.MultiaddrDNSResolver.ResolveDNSComponent(ctx context.Context, maddr Multiaddr, outputLimit int) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/core/network.Network.InterfaceListenAddresses() ([]Multiaddr, error) func github.com/libp2p/go-libp2p/core/network.Network.ListenAddresses() []Multiaddr func github.com/libp2p/go-libp2p/core/peer.AddrInfoToP2pAddrs(pi *peer.AddrInfo) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/core/peer.SplitAddr(m Multiaddr) (transport Multiaddr, id peer.ID) func github.com/libp2p/go-libp2p/core/peerstore.AddrBook.Addrs(p peer.ID) []Multiaddr func github.com/libp2p/go-libp2p/core/peerstore.AddrBook.AddrStream(context.Context, peer.ID) <-chan Multiaddr func github.com/libp2p/go-libp2p/core/peerstore.Peerstore.Addrs(p peer.ID) []Multiaddr func github.com/libp2p/go-libp2p/core/peerstore.Peerstore.AddrStream(context.Context, peer.ID) <-chan Multiaddr func github.com/libp2p/go-libp2p/core/transport.CapableConn.LocalMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/core/transport.CapableConn.RemoteMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/core/transport.GatedMaListener.Multiaddr() Multiaddr func github.com/libp2p/go-libp2p/core/transport.Listener.Multiaddr() Multiaddr func github.com/libp2p/go-libp2p/core/transport.Resolver.Resolve(ctx context.Context, maddr Multiaddr) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/core/transport.TransportNetwork.InterfaceListenAddresses() ([]Multiaddr, error) func github.com/libp2p/go-libp2p/core/transport.TransportNetwork.ListenAddresses() []Multiaddr func github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).Addrs() []Multiaddr func github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).AllAddrs() []Multiaddr func github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).ConfirmedAddrs() (reachable []Multiaddr, unreachable []Multiaddr, unknown []Multiaddr) func github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).ConfirmedAddrs() (reachable []Multiaddr, unreachable []Multiaddr, unknown []Multiaddr) func github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).ConfirmedAddrs() (reachable []Multiaddr, unreachable []Multiaddr, unknown []Multiaddr) func github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).NormalizeMultiaddr(addr Multiaddr) Multiaddr func github.com/libp2p/go-libp2p/p2p/host/basic.NATManager.GetMapping(Multiaddr) Multiaddr func github.com/libp2p/go-libp2p/p2p/host/blank.(*BlankHost).Addrs() []Multiaddr func github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem.(*AddrSubManager).AddrStream(ctx context.Context, p peer.ID, initial []Multiaddr) <-chan Multiaddr func github.com/libp2p/go-libp2p/p2p/host/routed.(*RoutedHost).Addrs() []Multiaddr func github.com/libp2p/go-libp2p/p2p/net/swarm.(*Conn).LocalMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/p2p/net/swarm.(*Conn).RemoteMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/p2p/net/swarm.ResolverFromMaDNS.ResolveDNSAddr(ctx context.Context, expectedPeerID peer.ID, maddr Multiaddr, recursionLimit int, outputLimit int) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/p2p/net/swarm.ResolverFromMaDNS.ResolveDNSComponent(ctx context.Context, maddr Multiaddr, outputLimit int) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/p2p/net/swarm.(*Swarm).InterfaceListenAddresses() ([]Multiaddr, error) func github.com/libp2p/go-libp2p/p2p/net/swarm.(*Swarm).ListenAddresses() []Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client.(*Conn).LocalMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client.(*Conn).RemoteMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client.(*Listener).Multiaddr() Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/holepunch.AddrFilter.FilterLocal(remoteID peer.ID, maddrs []Multiaddr) []Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/holepunch.AddrFilter.FilterRemote(remoteID peer.ID, maddrs []Multiaddr) []Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/identify.IDService.ObservedAddrsFor(local Multiaddr) []Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/identify.IDService.OwnObservedAddrs() []Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/identify.(*ObservedAddrManager).Addrs() []Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/identify.(*ObservedAddrManager).AddrsFor(addr Multiaddr) (addrs []Multiaddr) func github.com/libp2p/go-libp2p/p2p/transport/quicreuse.ToQuicMultiaddr(na net.Addr, version quic.Version) (Multiaddr, error) func github.com/libp2p/go-libp2p/p2p/transport/quicreuse.Listener.Multiaddrs() []Multiaddr func github.com/libp2p/go-libp2p/p2p/transport/tcpreuse/internal/sampledconn.ManetTCPConnInterface.LocalMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/p2p/transport/tcpreuse/internal/sampledconn.ManetTCPConnInterface.RemoteMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/p2p/transport/webrtc.(*WebRTCTransport).AddCertHashes(addr Multiaddr) (Multiaddr, bool) func github.com/libp2p/go-libp2p/p2p/transport/websocket.ParseWebsocketNetAddr(a net.Addr) (Multiaddr, error) func github.com/libp2p/go-libp2p/p2p/transport/websocket.(*Conn).LocalMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/p2p/transport/websocket.(*Conn).RemoteMultiaddr() Multiaddr func github.com/libp2p/go-libp2p/p2p/transport/websocket.(*WebsocketTransport).Resolve(_ context.Context, maddr Multiaddr) ([]Multiaddr, error) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).GetPeerAddrs() ([]Multiaddr, error) func Contains(addrs []Multiaddr, addr Multiaddr) bool func Contains(addrs []Multiaddr, addr Multiaddr) bool func FilterAddrs(a []Multiaddr, filters ...func(Multiaddr) bool) []Multiaddr func ForEach(m Multiaddr, cb func(c Component) bool) func Split(m Multiaddr) []Component func SplitFirst(m Multiaddr) (*Component, Multiaddr) func SplitFunc(m Multiaddr, cb func(Component) bool) (Multiaddr, Multiaddr) func SplitLast(m Multiaddr) (Multiaddr, *Component) func Unique(addrs []Multiaddr) []Multiaddr func (*Filters).AddrBlocked(a Multiaddr) (deny bool) func Multiaddr.Compare(o Multiaddr) int func Multiaddr.Equal(m2 Multiaddr) bool func github.com/multiformats/go-multiaddr/net.AddrMatch(match Multiaddr, addrs []Multiaddr) []Multiaddr func github.com/multiformats/go-multiaddr/net.AddrMatch(match Multiaddr, addrs []Multiaddr) []Multiaddr func github.com/multiformats/go-multiaddr/net.Dial(remote Multiaddr) (manet.Conn, error) func github.com/multiformats/go-multiaddr/net.DialArgs(m Multiaddr) (string, string, error) func github.com/multiformats/go-multiaddr/net.IsIP6LinkLocal(m Multiaddr) bool func github.com/multiformats/go-multiaddr/net.IsIPLoopback(m Multiaddr) bool func github.com/multiformats/go-multiaddr/net.IsIPUnspecified(m Multiaddr) bool func github.com/multiformats/go-multiaddr/net.IsNAT64IPv4ConvertedIPv6Addr(addr Multiaddr) bool func github.com/multiformats/go-multiaddr/net.IsPrivateAddr(a Multiaddr) bool func github.com/multiformats/go-multiaddr/net.IsPublicAddr(a Multiaddr) bool func github.com/multiformats/go-multiaddr/net.IsThinWaist(m Multiaddr) bool func github.com/multiformats/go-multiaddr/net.Listen(laddr Multiaddr) (manet.Listener, error) func github.com/multiformats/go-multiaddr/net.ListenPacket(laddr Multiaddr) (manet.PacketConn, error) func github.com/multiformats/go-multiaddr/net.MultiaddrToIPNet(m Multiaddr) (*net.IPNet, error) func github.com/multiformats/go-multiaddr/net.ResolveUnspecifiedAddress(resolve Multiaddr, ifaceAddrs []Multiaddr) ([]Multiaddr, error) func github.com/multiformats/go-multiaddr/net.ResolveUnspecifiedAddress(resolve Multiaddr, ifaceAddrs []Multiaddr) ([]Multiaddr, error) func github.com/multiformats/go-multiaddr/net.ResolveUnspecifiedAddresses(unspecAddrs, ifaceAddrs []Multiaddr) ([]Multiaddr, error) func github.com/multiformats/go-multiaddr/net.ToIP(addr Multiaddr) (net.IP, error) func github.com/multiformats/go-multiaddr/net.ToNetAddr(maddr Multiaddr) (net.Addr, error) func github.com/multiformats/go-multiaddr/net.(*CodecMap).ToNetAddr(maddr Multiaddr) (net.Addr, error) func github.com/multiformats/go-multiaddr/net.(*Dialer).Dial(remote Multiaddr) (manet.Conn, error) func github.com/multiformats/go-multiaddr/net.(*Dialer).DialContext(ctx context.Context, remote Multiaddr) (manet.Conn, error) func github.com/multiformats/go-multiaddr/net.PacketConn.WriteToMultiaddr(b []byte, maddr Multiaddr) (int, error) func github.com/multiformats/go-multiaddr-dns.Matches(maddr Multiaddr) (matches bool) func github.com/multiformats/go-multiaddr-dns.Resolve(ctx context.Context, maddr Multiaddr) ([]Multiaddr, error) func github.com/multiformats/go-multiaddr-dns.(*Resolver).Resolve(ctx context.Context, maddr Multiaddr) ([]Multiaddr, error) func github.com/multiformats/go-multiaddr-fmt.Base.Matches(a Multiaddr) bool func github.com/multiformats/go-multiaddr-fmt.Pattern.Matches(Multiaddr) bool func github.com/libp2p/go-libp2p.ListenAddrs(addrs ...Multiaddr) libp2p.Option func github.com/libp2p/go-libp2p/core/canonicallog.LogMisbehavingPeer(p peer.ID, peerAddr Multiaddr, component string, err error, msg string) func github.com/libp2p/go-libp2p/core/canonicallog.LogPeerStatus(sampleRate int, p peer.ID, peerAddr Multiaddr, keyVals ...string) func github.com/libp2p/go-libp2p/core/connmgr.ConnectionGater.InterceptAddrDial(peer.ID, Multiaddr) (allow bool) func github.com/libp2p/go-libp2p/core/network.Dialer.CanDial(p peer.ID, addr Multiaddr) bool func github.com/libp2p/go-libp2p/core/network.MultiaddrDNSResolver.ResolveDNSAddr(ctx context.Context, expectedPeerID peer.ID, maddr Multiaddr, recursionLimit, outputLimit int) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/core/network.MultiaddrDNSResolver.ResolveDNSComponent(ctx context.Context, maddr Multiaddr, outputLimit int) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/core/network.Network.CanDial(p peer.ID, addr Multiaddr) bool func github.com/libp2p/go-libp2p/core/network.Network.Listen(...Multiaddr) error func github.com/libp2p/go-libp2p/core/network.(*NoopNotifiee).Listen(_ network.Network, _ Multiaddr) func github.com/libp2p/go-libp2p/core/network.(*NoopNotifiee).ListenClose(_ network.Network, _ Multiaddr) func github.com/libp2p/go-libp2p/core/network.Notifiee.Listen(network.Network, Multiaddr) func github.com/libp2p/go-libp2p/core/network.Notifiee.ListenClose(network.Network, Multiaddr) func github.com/libp2p/go-libp2p/core/network.(*NotifyBundle).Listen(n network.Network, a Multiaddr) func github.com/libp2p/go-libp2p/core/network.(*NotifyBundle).ListenClose(n network.Network, a Multiaddr) func github.com/libp2p/go-libp2p/core/network.(*NullResourceManager).OpenConnection(_ network.Direction, _ bool, _ Multiaddr) (network.ConnManagementScope, error) func github.com/libp2p/go-libp2p/core/network.ResourceManager.OpenConnection(dir network.Direction, usefd bool, endpoint Multiaddr) (network.ConnManagementScope, error) func github.com/libp2p/go-libp2p/core/peer.AddrInfoFromP2pAddr(m Multiaddr) (*peer.AddrInfo, error) func github.com/libp2p/go-libp2p/core/peer.AddrInfosFromP2pAddrs(maddrs ...Multiaddr) ([]peer.AddrInfo, error) func github.com/libp2p/go-libp2p/core/peer.IDFromP2PAddr(m Multiaddr) (peer.ID, error) func github.com/libp2p/go-libp2p/core/peer.SplitAddr(m Multiaddr) (transport Multiaddr, id peer.ID) func github.com/libp2p/go-libp2p/core/peerstore.AddrBook.AddAddr(p peer.ID, addr Multiaddr, ttl time.Duration) func github.com/libp2p/go-libp2p/core/peerstore.AddrBook.AddAddrs(p peer.ID, addrs []Multiaddr, ttl time.Duration) func github.com/libp2p/go-libp2p/core/peerstore.AddrBook.SetAddr(p peer.ID, addr Multiaddr, ttl time.Duration) func github.com/libp2p/go-libp2p/core/peerstore.AddrBook.SetAddrs(p peer.ID, addrs []Multiaddr, ttl time.Duration) func github.com/libp2p/go-libp2p/core/peerstore.Peerstore.AddAddr(p peer.ID, addr Multiaddr, ttl time.Duration) func github.com/libp2p/go-libp2p/core/peerstore.Peerstore.AddAddrs(p peer.ID, addrs []Multiaddr, ttl time.Duration) func github.com/libp2p/go-libp2p/core/peerstore.Peerstore.SetAddr(p peer.ID, addr Multiaddr, ttl time.Duration) func github.com/libp2p/go-libp2p/core/peerstore.Peerstore.SetAddrs(p peer.ID, addrs []Multiaddr, ttl time.Duration) func github.com/libp2p/go-libp2p/core/transport.DialUpdater.DialWithUpdates(context.Context, Multiaddr, peer.ID, chan<- transport.DialUpdate) (transport.CapableConn, error) func github.com/libp2p/go-libp2p/core/transport.Resolver.Resolve(ctx context.Context, maddr Multiaddr) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/core/transport.SkipResolver.SkipResolve(ctx context.Context, maddr Multiaddr) bool func github.com/libp2p/go-libp2p/core/transport.Transport.CanDial(addr Multiaddr) bool func github.com/libp2p/go-libp2p/core/transport.Transport.Dial(ctx context.Context, raddr Multiaddr, p peer.ID) (transport.CapableConn, error) func github.com/libp2p/go-libp2p/core/transport.Transport.Listen(laddr Multiaddr) (transport.Listener, error) func github.com/libp2p/go-libp2p/core/transport.TransportNetwork.CanDial(p peer.ID, addr Multiaddr) bool func github.com/libp2p/go-libp2p/core/transport.TransportNetwork.Listen(...Multiaddr) error func github.com/libp2p/go-libp2p/p2p/host/autonat.(*AmbientAutoNAT).Listen(_ network.Network, _ Multiaddr) func github.com/libp2p/go-libp2p/p2p/host/autonat.(*AmbientAutoNAT).ListenClose(_ network.Network, _ Multiaddr) func github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).NormalizeMultiaddr(addr Multiaddr) Multiaddr func github.com/libp2p/go-libp2p/p2p/host/basic.MetricsTracker.ConfirmedAddrsChanged(reachable, unreachable, unknown []Multiaddr) func github.com/libp2p/go-libp2p/p2p/host/basic.NATManager.GetMapping(Multiaddr) Multiaddr func github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem.(*AddrSubManager).AddrStream(ctx context.Context, p peer.ID, initial []Multiaddr) <-chan Multiaddr func github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem.(*AddrSubManager).BroadcastAddr(p peer.ID, addr Multiaddr) func github.com/libp2p/go-libp2p/p2p/host/resource-manager.WithAllowlistedMultiaddrs(mas []Multiaddr) rcmgr.Option func github.com/libp2p/go-libp2p/p2p/host/resource-manager.(*Allowlist).Add(ma Multiaddr) error func github.com/libp2p/go-libp2p/p2p/host/resource-manager.(*Allowlist).Allowed(ma Multiaddr) bool func github.com/libp2p/go-libp2p/p2p/host/resource-manager.(*Allowlist).AllowedPeerAndMultiaddr(peerID peer.ID, ma Multiaddr) bool func github.com/libp2p/go-libp2p/p2p/host/resource-manager.(*Allowlist).Remove(ma Multiaddr) error func github.com/libp2p/go-libp2p/p2p/metricshelper.GetIPVersion(addr Multiaddr) string func github.com/libp2p/go-libp2p/p2p/metricshelper.GetTransport(a Multiaddr) string func github.com/libp2p/go-libp2p/p2p/net/reuseport.(*Transport).Dial(raddr Multiaddr) (manet.Conn, error) func github.com/libp2p/go-libp2p/p2p/net/reuseport.(*Transport).DialContext(ctx context.Context, raddr Multiaddr) (manet.Conn, error) func github.com/libp2p/go-libp2p/p2p/net/reuseport.(*Transport).Listen(laddr Multiaddr) (manet.Listener, error) func github.com/libp2p/go-libp2p/p2p/net/swarm.DefaultDialRanker(addrs []Multiaddr) []network.AddrDelay func github.com/libp2p/go-libp2p/p2p/net/swarm.NoDelayDialRanker(addrs []Multiaddr) []network.AddrDelay func github.com/libp2p/go-libp2p/p2p/net/swarm.(*DialBackoff).AddBackoff(p peer.ID, addr Multiaddr) func github.com/libp2p/go-libp2p/p2p/net/swarm.(*DialBackoff).Backoff(p peer.ID, addr Multiaddr) (backoff bool) func github.com/libp2p/go-libp2p/p2p/net/swarm.MetricsTracer.ClosedConnection(network.Direction, time.Duration, network.ConnectionState, Multiaddr) func github.com/libp2p/go-libp2p/p2p/net/swarm.MetricsTracer.CompletedHandshake(time.Duration, network.ConnectionState, Multiaddr) func github.com/libp2p/go-libp2p/p2p/net/swarm.MetricsTracer.FailedDialing(Multiaddr, error, error) func github.com/libp2p/go-libp2p/p2p/net/swarm.MetricsTracer.OpenedConnection(network.Direction, crypto.PubKey, network.ConnectionState, Multiaddr) func github.com/libp2p/go-libp2p/p2p/net/swarm.ResolverFromMaDNS.ResolveDNSAddr(ctx context.Context, expectedPeerID peer.ID, maddr Multiaddr, recursionLimit int, outputLimit int) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/p2p/net/swarm.ResolverFromMaDNS.ResolveDNSComponent(ctx context.Context, maddr Multiaddr, outputLimit int) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/p2p/net/swarm.(*Swarm).AddListenAddr(a Multiaddr) error func github.com/libp2p/go-libp2p/p2p/net/swarm.(*Swarm).CanDial(p peer.ID, addr Multiaddr) bool func github.com/libp2p/go-libp2p/p2p/net/swarm.(*Swarm).Listen(addrs ...Multiaddr) error func github.com/libp2p/go-libp2p/p2p/net/swarm.(*Swarm).ListenClose(addrs ...Multiaddr) func github.com/libp2p/go-libp2p/p2p/net/swarm.(*Swarm).TransportForDialing(a Multiaddr) transport.Transport func github.com/libp2p/go-libp2p/p2p/net/swarm.(*Swarm).TransportForListening(a Multiaddr) transport.Transport func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client.(*Client).CanDial(addr Multiaddr) bool func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client.(*Client).Dial(ctx context.Context, a Multiaddr, p peer.ID) (transport.CapableConn, error) func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client.(*Client).Listen(addr Multiaddr) (transport.Listener, error) func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client.(*Client).SkipResolve(_ context.Context, _ Multiaddr) bool func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay.ACLFilter.AllowConnect(src peer.ID, srcAddr Multiaddr, dest peer.ID) bool func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay.ACLFilter.AllowReserve(p peer.ID, a Multiaddr) bool func github.com/libp2p/go-libp2p/p2p/protocol/holepunch.AddrFilter.FilterLocal(remoteID peer.ID, maddrs []Multiaddr) []Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/holepunch.AddrFilter.FilterRemote(remoteID peer.ID, maddrs []Multiaddr) []Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/holepunch.MetricsTracer.HolePunchFinished(side string, attemptNum int, theirAddrs []Multiaddr, ourAddr []Multiaddr, directConn network.ConnMultiaddrs) func github.com/libp2p/go-libp2p/p2p/protocol/holepunch.MetricsTracer.HolePunchFinished(side string, attemptNum int, theirAddrs []Multiaddr, ourAddr []Multiaddr, directConn network.ConnMultiaddrs) func github.com/libp2p/go-libp2p/p2p/protocol/identify.HasConsistentTransport(a Multiaddr, green []Multiaddr) bool func github.com/libp2p/go-libp2p/p2p/protocol/identify.HasConsistentTransport(a Multiaddr, green []Multiaddr) bool func github.com/libp2p/go-libp2p/p2p/protocol/identify.IDService.ObservedAddrsFor(local Multiaddr) []Multiaddr func github.com/libp2p/go-libp2p/p2p/protocol/identify.(*ObservedAddrManager).AddrsFor(addr Multiaddr) (addrs []Multiaddr) func github.com/libp2p/go-libp2p/p2p/protocol/identify.(*ObservedAddrManager).Record(conn identify.connMultiaddrs, observed Multiaddr) func github.com/libp2p/go-libp2p/p2p/transport/quicreuse.FromQuicMultiaddr(addr Multiaddr) (*net.UDPAddr, quic.Version, error) func github.com/libp2p/go-libp2p/p2p/transport/quicreuse.(*ConnManager).DialQUIC(ctx context.Context, raddr Multiaddr, tlsConf *tls.Config, allowWindowIncrease func(conn quic.Connection, delta uint64) bool) (quic.Connection, error) func github.com/libp2p/go-libp2p/p2p/transport/quicreuse.(*ConnManager).ListenQUIC(addr Multiaddr, tlsConf *tls.Config, allowWindowIncrease func(conn quic.Connection, delta uint64) bool) (quicreuse.Listener, error) func github.com/libp2p/go-libp2p/p2p/transport/quicreuse.(*ConnManager).ListenQUICAndAssociate(association any, addr Multiaddr, tlsConf *tls.Config, allowWindowIncrease func(conn quic.Connection, delta uint64) bool) (quicreuse.Listener, error) func github.com/libp2p/go-libp2p/p2p/transport/tcp.(*TcpTransport).CanDial(addr Multiaddr) bool func github.com/libp2p/go-libp2p/p2p/transport/tcp.(*TcpTransport).Dial(ctx context.Context, raddr Multiaddr, p peer.ID) (transport.CapableConn, error) func github.com/libp2p/go-libp2p/p2p/transport/tcp.(*TcpTransport).DialWithUpdates(ctx context.Context, raddr Multiaddr, p peer.ID, updateChan chan<- transport.DialUpdate) (transport.CapableConn, error) func github.com/libp2p/go-libp2p/p2p/transport/tcp.(*TcpTransport).Listen(laddr Multiaddr) (transport.Listener, error) func github.com/libp2p/go-libp2p/p2p/transport/tcpreuse.(*ConnMgr).DemultiplexedListen(laddr Multiaddr, connType tcpreuse.DemultiplexedConnType) (transport.GatedMaListener, error) func github.com/libp2p/go-libp2p/p2p/transport/tcpreuse.(*ConnMgr).DialContext(ctx context.Context, raddr Multiaddr) (manet.Conn, error) func github.com/libp2p/go-libp2p/p2p/transport/webrtc.IsWebRTCDirectMultiaddr(addr Multiaddr) (bool, int) func github.com/libp2p/go-libp2p/p2p/transport/webrtc.(*WebRTCTransport).AddCertHashes(addr Multiaddr) (Multiaddr, bool) func github.com/libp2p/go-libp2p/p2p/transport/webrtc.(*WebRTCTransport).CanDial(addr Multiaddr) bool func github.com/libp2p/go-libp2p/p2p/transport/webrtc.(*WebRTCTransport).Dial(ctx context.Context, remoteMultiaddr Multiaddr, p peer.ID) (tpt.CapableConn, error) func github.com/libp2p/go-libp2p/p2p/transport/webrtc.(*WebRTCTransport).Listen(addr Multiaddr) (tpt.Listener, error) func github.com/libp2p/go-libp2p/p2p/transport/websocket.ConvertWebsocketMultiaddrToNetAddr(maddr Multiaddr) (net.Addr, error) func github.com/libp2p/go-libp2p/p2p/transport/websocket.(*WebsocketTransport).CanDial(a Multiaddr) bool func github.com/libp2p/go-libp2p/p2p/transport/websocket.(*WebsocketTransport).Dial(ctx context.Context, raddr Multiaddr, p peer.ID) (transport.CapableConn, error) func github.com/libp2p/go-libp2p/p2p/transport/websocket.(*WebsocketTransport).Listen(a Multiaddr) (transport.Listener, error) func github.com/libp2p/go-libp2p/p2p/transport/websocket.(*WebsocketTransport).Resolve(_ context.Context, maddr Multiaddr) ([]Multiaddr, error) func github.com/libp2p/go-libp2p/p2p/transport/webtransport.IsWebtransportMultiaddr(multiaddr Multiaddr) (bool, int) func github.com/pancsta/asyncmachine-go/pkg/pubsub/uds.(*UdsTransport).CanDial(addr Multiaddr) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub/uds.(*UdsTransport).Dial(ctx context.Context, raddr Multiaddr, p peer.ID) (transport.CapableConn, error) func github.com/pancsta/asyncmachine-go/pkg/pubsub/uds.(*UdsTransport).DialWithUpdates(ctx context.Context, raddr Multiaddr, p peer.ID, updateChan chan<- transport.DialUpdate) (transport.CapableConn, error) func github.com/pancsta/asyncmachine-go/pkg/pubsub/uds.(*UdsTransport).Listen(laddr Multiaddr) (transport.Listener, error) var github.com/multiformats/go-multiaddr/net.IP4Loopback var github.com/multiformats/go-multiaddr/net.IP4MappedIP6Loopback var github.com/multiformats/go-multiaddr/net.IP4Unspecified var github.com/multiformats/go-multiaddr/net.IP6Loopback var github.com/multiformats/go-multiaddr/net.IP6Unspecified
Multiaddr returns the Multiaddr representation *Component Multiaddr github.com/multiformats/go-multiaddr/net.Listener (interface) github.com/libp2p/go-libp2p/core/transport.GatedMaListener (interface) github.com/libp2p/go-libp2p/core/transport.Listener (interface) *github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client.Listener func Join(msInterfaces ...Multiaddrer) Multiaddr func (*Component).Decapsulate(o Multiaddrer) Multiaddr func (*Component).Encapsulate(o Multiaddrer) Multiaddr func Multiaddr.Decapsulate(rightPartsAny Multiaddrer) Multiaddr func Multiaddr.Encapsulate(other Multiaddrer) Multiaddr
Protocol is a Multiaddr protocol description structure. Code is the protocol's multicodec (a normal, non-varint number). Name is the string representation of the protocol code. E.g., ip4, ip6, tcp, udp, etc. Path indicates a path protocol (e.g., unix). When parsing multiaddr strings, path protocols consume the remainder of the address instead of stopping at the next forward slash. Size must be LengthPrefixedVarSize. Size is the size of the argument to this protocol. * Size == 0 means this protocol takes no argument. * Size > 0 means this protocol takes a constant sized argument. * Size < 0 means this protocol takes a variable length, varint prefixed argument. // a size of -1 indicates a length-prefixed variable size Transcoder converts between the byte representation and the string representation of this protocol's argument (if any). This should only be non-nil if Size != 0 VCode is a precomputed varint encoded version of Code. func ProtocolsWithString(s string) ([]Protocol, error) func ProtocolWithCode(c int) Protocol func ProtocolWithName(s string) Protocol func (*Component).Protocol() Protocol func (*Component).Protocols() []Protocol func Multiaddr.Protocols() []Protocol func AddProtocol(p Protocol) error
Validates and decodes to a string a multiaddr that's in the bytes representation. Validates and encodes to bytes a multiaddr that's in the string representation. Validates bytes when parsing a multiaddr that's already in the bytes representation. func NewTranscoderFromFunctions(s2b func(string) ([]byte, error), b2s func([]byte) (string, error), val func([]byte) error) Transcoder var TranscoderCertHash var TranscoderDns var TranscoderGarlic32 var TranscoderGarlic64 var TranscoderHTTPPath var TranscoderIP4 var TranscoderIP6 var TranscoderIP6Zone var TranscoderIPCIDR var TranscoderMemory var TranscoderOnion var TranscoderOnion3 var TranscoderP2P var TranscoderPort var TranscoderUnix
Package-Level Functions (total 23)
func CaptureAddrPort(network *string, ipPort *netip.AddrPort) (capturePattern meg.Pattern)
Cast re-casts a byte slice as a multiaddr. will panic if it fails to parse.
CodeToVarint converts an integer to a varint-encoded []byte
Contains reports whether addr is contained in addrs.
FilterAddrs is a filter that removes certain addresses, according to the given filters. If all filters return true, the address is kept.
ForEach walks over the multiaddr, component by component. This function iterates over components. Return true to continue iteration, false to stop. Prefer a standard for range loop instead e.g. `for _, c := range m { ... }`
Join returns a combination of addresses. Note: This copies all the components from the input Multiaddrs. Depending on your use case, you may prefer to use `append(leftMA, rightMA...)` instead.
NewComponent constructs a new multiaddr component
NewFilters constructs and returns a new set of net.IPNet filters. By default, the new filter accepts all addresses.
NewMultiaddr parses and validates an input string, returning a *Multiaddr
NewMultiaddrBytes initializes a Multiaddr from a byte representation. It validates it as an input string.
func NewTranscoderFromFunctions(s2b func(string) ([]byte, error), b2s func([]byte) (string, error), val func([]byte) error) Transcoder
ProtocolsWithString returns a slice of protocols matching given string.
ProtocolWithCode returns the Protocol description with given protocol code.
ProtocolWithName returns the Protocol description with given string name.
Split returns the sub-address portions of a multiaddr.
SplitFirst returns the first component and the rest of the multiaddr.
SplitFunc splits the multiaddr when the callback first returns true. The component on which the callback first returns will be included in the *second* multiaddr.
SplitLast returns the rest of the multiaddr and the last component.
StringCast like Cast, but parses a string. Will also panic if it fails to parse.
Unique deduplicates addresses in place, leave only unique addresses. It doesn't allocate.
Package-Level Constants (total 43)
const ActionAccept Action = 1
const ActionDeny Action = 2
const ActionNone Action = 0 // zero value.
These are special sizes
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.
You **MUST** register your multicodecs with https://github.com/multiformats/multicodec before adding them here.