addr

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HasTls = regexp.MustCompile("\\+tls")
View Source
var PlusEnd = regexp.MustCompile("\\+.+$")

Functions

func ResolveHostAddress

func ResolveHostAddress(addr string) (*net.TCPAddr, error)

ResolveHostAddress will take an address as a string and try to parse it into a net.TCPAddr using `net.ResolveTCPAddr`. If unsuccessful, it will wrap an error and return it.

Types

type ProtoAddress

type ProtoAddress struct {
	url.URL
}

ProtoAddress is a combination of network type and address.

func MustParseAddress

func MustParseAddress(addr string) ProtoAddress

MustParseAddress will parse the address and panic if it can't

func ParseAddress

func ParseAddress(addr string) (*ProtoAddress, error)

ParseAddress does the reserse of ProtoAddress.String -- it will take a string and convert it an address.

func (*ProtoAddress) Addr added in v2.1.0

func (pa *ProtoAddress) Addr() (net.Addr, error)

func (*ProtoAddress) UnmarshalFlag

func (pa *ProtoAddress) UnmarshalFlag(s string) error

func (*ProtoAddress) UnmarshalJSON

func (pa *ProtoAddress) UnmarshalJSON(b []byte) error

type ProtoName

type ProtoName struct {
	Name string `` /* 130-byte string literal not displayed */
}

ProtoName defines the name so that we don't need to repeat it over and over again

type StandardIOAddress added in v2.1.0

type StandardIOAddress struct {
	Address string
}

func (StandardIOAddress) Network added in v2.1.0

func (StandardIOAddress) Network() string

func (*StandardIOAddress) String added in v2.1.0

func (s *StandardIOAddress) String() string

Jump to

Keyboard shortcuts

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