utils

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2018 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrIsLocal added in v0.11.0

func AddrIsLocal(addr net.Addr) bool

AddrIsLocal returns whether the address is from a trusted local connection (loopback or unix).

func AddrIsUnix added in v0.11.0

func AddrIsUnix(addr net.Addr) bool

AddrIsUnix returns whether the address is a unix domain socket.

func AddrLookupHostname

func AddrLookupHostname(addr net.Addr) string

AddrLookupHostname returns the hostname (if possible) or address for the given `net.Addr`.

func AddrToIP added in v0.11.0

func AddrToIP(addr net.Addr) net.IP

AddrToIP returns the IP address for a net.Addr, or nil if it's a unix domain socket.

func ArgsToStrings

func ArgsToStrings(maxLength int, arguments []string, delim string) []string

ArgsToStrings takes the arguments and splits them into a series of strings, each argument separated by delim and each string bounded by maxLength.

func ExtractParam added in v0.11.0

func ExtractParam(line string) (string, string)

ExtractParam extracts a parameter from the given string, returning the param and the rest of the string.

func GetClientOnlyTags added in v0.11.0

func GetClientOnlyTags(tags map[string]ircmsg.TagValue) *map[string]ircmsg.TagValue

GetClientOnlyTags takes a tag map and returns a map containing just the client-only tags from it.

func IPString

func IPString(addr net.Addr) string

IPString returns a simple IP string from the given net.Addr.

func IsHostname

func IsHostname(name string) bool

IsHostname returns whether we consider `name` a valid hostname.

func LookupHostname

func LookupHostname(addr string) string

LookupHostname returns the hostname for `addr` if it has one. Otherwise, just returns `addr`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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