Versions in this module Expand all Collapse all v0 v0.0.5 Dec 20, 2024 v0.0.4 Dec 15, 2024 Changes in this version + const P_CERTHASH + const P_HTTP_PATH + const P_IPCIDR + const P_MEMORY + const P_PLAINTEXTV2 + const P_QUIC_V1 + const P_SNI + const P_WEBRTC + const P_WEBRTC_DIRECT + const P_WEBTRANSPORT + var TranscoderCertHash = NewTranscoderFromFunctions(certHashStB, certHashBtS, validateCertHash) + var TranscoderHTTPPath = NewTranscoderFromFunctions(httpPathStB, httpPathBtS, validateHTTPPath) + var TranscoderIPCIDR = NewTranscoderFromFunctions(ipcidrStB, ipcidrBtS, ipcidrValidate) + var TranscoderMemory = NewTranscoderFromFunctions(memoryStB, memoryBtS, memoryValidate) + func Contains(addrs []Multiaddr, addr Multiaddr) bool type Multiaddr + func FilterAddrs(a []Multiaddr, filters ...func(Multiaddr) bool) []Multiaddr + func Unique(addrs []Multiaddr) []Multiaddr v0.0.3 Aug 28, 2021 Changes in this version + var TranscoderDMS3 = NewTranscoderFromFunctions(dms3StB, dms3BtS, dms3Val) v0.0.2 Aug 20, 2021 v0.0.1 Aug 11, 2021 Changes in this version + const LengthPrefixedVarSize + const P_CIRCUIT + const P_DCCP + const P_DMS3 + const P_DNS + const P_DNS4 + const P_DNS6 + const P_DNSADDR + const P_GARLIC32 + const P_GARLIC64 + const P_HTTP + const P_HTTPS + const P_IP4 + const P_IP6 + const P_IP6ZONE + const P_IPFS + const P_NOISE + const P_ONION + const P_ONION3 + const P_P2P + const P_P2P_WEBRTC_DIRECT + const P_QUIC + const P_SCTP + const P_TCP + const P_TLS + const P_UDP + const P_UDT + const P_UNIX + const P_UTP + const P_WS + const P_WSS + var ErrProtocolNotFound = fmt.Errorf("protocol not found in multiaddr") + var Protocols = []Protocol + var TranscoderDns = NewTranscoderFromFunctions(dnsStB, dnsBtS, dnsVal) + var TranscoderGarlic32 = NewTranscoderFromFunctions(garlic32StB, garlic32BtS, garlic32Validate) + var TranscoderGarlic64 = NewTranscoderFromFunctions(garlic64StB, garlic64BtS, garlic64Validate) + var TranscoderIP4 = NewTranscoderFromFunctions(ip4StB, ip4BtS, nil) + var TranscoderIP6 = NewTranscoderFromFunctions(ip6StB, ip6BtS, nil) + var TranscoderIP6Zone = NewTranscoderFromFunctions(ip6zoneStB, ip6zoneBtS, ip6zoneVal) + var TranscoderOnion = NewTranscoderFromFunctions(onionStB, onionBtS, nil) + var TranscoderOnion3 = NewTranscoderFromFunctions(onion3StB, onion3BtS, nil) + var TranscoderP2P = NewTranscoderFromFunctions(p2pStB, p2pBtS, p2pVal) + var TranscoderPort = NewTranscoderFromFunctions(portStB, portBtS, nil) + var TranscoderUnix = NewTranscoderFromFunctions(unixStB, unixBtS, nil) + func AddProtocol(p Protocol) error + func CodeToVarint(num int) []byte + func ForEach(m Multiaddr, cb func(c Component) bool) + func ReadVarintCode(b []byte) (int, int, error) + func SplitFirst(m Multiaddr) (*Component, Multiaddr) + func SplitFunc(m Multiaddr, cb func(Component) bool) (Multiaddr, Multiaddr) + func SplitLast(m Multiaddr) (Multiaddr, *Component) + type Action int32 + const ActionAccept + const ActionDeny + const ActionNone + type Component struct + func NewComponent(protocol, value string) (*Component, error) + func (c *Component) Bytes() []byte + func (c *Component) Decapsulate(o Multiaddr) Multiaddr + func (c *Component) Encapsulate(o Multiaddr) Multiaddr + func (c *Component) Equal(o Multiaddr) bool + func (c *Component) MarshalBinary() ([]byte, error) + func (c *Component) MarshalJSON() ([]byte, error) + func (c *Component) MarshalText() ([]byte, error) + func (c *Component) Protocol() Protocol + func (c *Component) Protocols() []Protocol + func (c *Component) RawValue() []byte + func (c *Component) String() string + func (c *Component) UnmarshalBinary(data []byte) error + func (c *Component) UnmarshalText(data []byte) error + func (c *Component) Value() string + func (c *Component) ValueForProtocol(code int) (string, error) + func (m *Component) UnmarshalJSON(data []byte) error + type Filters struct + DefaultAction Action + func NewFilters() *Filters + func (fs *Filters) ActionForFilter(ipnet net.IPNet) (action Action, ok bool) + func (fs *Filters) AddFilter(ipnet net.IPNet, action Action) + func (fs *Filters) AddrBlocked(a Multiaddr) (deny bool) + func (fs *Filters) FiltersForAction(action Action) (result []net.IPNet) + func (fs *Filters) RemoveLiteral(ipnet net.IPNet) (removed bool) + type Multiaddr interface + Bytes func() []byte + Decapsulate func(Multiaddr) Multiaddr + Encapsulate func(Multiaddr) Multiaddr + Equal func(Multiaddr) bool + Protocols func() []Protocol + String func() string + ValueForProtocol func(code int) (string, error) + func Cast(b []byte) Multiaddr + func Join(ms ...Multiaddr) Multiaddr + func NewMultiaddr(s string) (a Multiaddr, err error) + func NewMultiaddrBytes(b []byte) (a Multiaddr, err error) + func Split(m Multiaddr) []Multiaddr + func StringCast(s string) Multiaddr + type Protocol struct + Code int + Name string + Path bool + Size int + Transcoder Transcoder + VCode []byte + func ProtocolWithCode(c int) Protocol + func ProtocolWithName(s string) Protocol + func ProtocolsWithString(s string) ([]Protocol, error) + type Transcoder interface + BytesToString func([]byte) (string, error) + StringToBytes func(string) ([]byte, error) + ValidateBytes func([]byte) error + func NewTranscoderFromFunctions(s2b func(string) ([]byte, error), b2s func([]byte) (string, error), ...) Transcoder