network

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	L4Protocol = "tcp"
)

Variables

This section is empty.

Functions

func HostAddrFromMultiaddr added in v0.20.0

func HostAddrFromMultiaddr(multiaddr string) (string, error)

HostAddrFromMultiaddr converts "/dns4/localhost/tcp/8080" to "localhost:8080".

func IsLocalAddress added in v0.12.0

func IsLocalAddress(src LocalAddressSource, addr *Address) bool

IsLocalAddress returns true if network endpoint from local address source is equal to network endpoint of passed address.

Types

type Address

type Address struct {
	// contains filtered or unexported fields
}

Address represents the NeoFS node network address.

func AddressFromString added in v0.12.0

func AddressFromString(s string) (*Address, error)

AddressFromString restores address from a multiaddr string representation.

func (*Address) AddTLS added in v0.21.0

func (a *Address) AddTLS()

AddTLS encapsulates a Address if there is no TLS yet.

func (*Address) Decapsulate added in v0.21.0

func (a *Address) Decapsulate(addr *Address)

Decapsulate removes an Address wrapping. For example:

/ip4/1.2.3.4/tcp/80 decapsulate /ip4/1.2.3.4 = /tcp/80

func (*Address) Encapsulate added in v0.21.0

func (a *Address) Encapsulate(addr *Address)

Encapsulate wraps this Address around another. For example:

/ip4/1.2.3.4 encapsulate /tcp/80 = /ip4/1.2.3.4/tcp/80

func (Address) Equal added in v0.21.0

func (a Address) Equal(addr *Address) bool

Equal compares Address's.

func (Address) HostAddrString added in v0.20.0

func (a Address) HostAddrString() (string, error)

HostAddrString returns host address in string format.

func (Address) IPAddrString added in v0.12.0

func (a Address) IPAddrString() (string, error)

IPAddrString returns network endpoint address in string format.

func (Address) String added in v0.12.0

func (a Address) String() string

String returns multiaddr string

func (Address) TLSEnabled added in v0.21.0

func (a Address) TLSEnabled() bool

TLSEnabled searches for wrapped TLS protocol in multiaddr.

type LocalAddressSource added in v0.12.0

type LocalAddressSource interface {
	LocalAddress() *Address
}

LocalAddressSource is an interface of local network address container with read access.

Directories

Path Synopsis
transport

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL