package
2.14.0+incompatible
Repository: https://github.com/ergochat/ergo.git
Documentation: pkg.go.dev

# Functions

AddrToIP returns the IP address for a net.Addr; unix domain sockets are treated as IPv4 loopback.
BitsetClear clears the bitset in-place.
BitsetCopy copies the contents of `other` over `set`.
BitsetCopyLocal copies the contents of `other` over `set`, without synchronizing the writes to `set`.
BitsetEmpty returns whether the bitset is empty.
BitsetGet returns whether a given bit of the bitset is set.
BitsetGetLocal returns whether a given bit of the bitset is set, without synchronization.
BitsetSet sets a given bit of the bitset to 0 or 1, returning whether it changed.
BitsetSubtract modifies `set` to subtract the contents of `other`.
BitsetUnion modifies `set` to be the union of `set` and `other`.
No description provided by the author
BuildTokenLines is a convenience to apply TokenLineBuilder to a predetermined slice of tokens.
No description provided by the author
Compile a list of globs into a single or-expression that matches any one of them.
Deterministically generates a confirmation code for some destructive activity; `name` is typically the name of the identity being destroyed (a channel being unregistered, or the server being crashed) and `createdAt` means a different value is required each time.
implementation of `cp` (go should really provide this...).
No description provided by the author
Output a description of a connection that can identify it to other systems administration tools.
FieldsFuncN is like strings.FieldsFunc, but returns at most n fields, and the nth field includes any runes at the end of the string normally excluded by f.
FieldsN is like strings.Fields, but returns at most n fields, and the nth field includes any whitespace at the end of the string.
generate a 256-bit secret key that can be written into a config file.
generate a secret token that cannot be brute-forced via online attacks.
No description provided by the author
No description provided by the author
Process the X-Forwarded-For header, validating against a list of trusted IPs.
Convenience to test whether `ip` is contained in any of `nets`.
IPStringToHostname converts a string representation of an IP address to an IRC-ready hostname.
IsHostname returns whether we consider `name` a valid hostname.
No description provided by the author
IsServerName returns whether we consider `name` a valid IRC server name.
LookupHostname does an (optionally reverse-confirmed) hostname lookup suitable for use as an IRC hostname.
No description provided by the author
No description provided by the author
Given a network, produce a human-readable string (i.e., CIDR if it's actually a network, IPv6 address if it's a v6 /128, dotted quad if it's a v4 /32).
No description provided by the author
NewSemaphore creates and initializes a semaphore to a given capacity.
Normalize openssl-formatted certfp's to oragono's format.
Parse a human-readable description (an address or CIDR, either v4 or v6) into a normalized v6 net.IPNet.
NormalizeIPToNet represents an address (v4 or v6) as the v6 /128 CIDR containing only it.
NormalizeNet normalizes an IPNet to a v6 CIDR, using the 4-in-6 prefix.
Parse a list of IPs and nets as they would appear in one of our config files, e.g., proxy-allowed-from or a throttling exemption list.
ParseProxyLine parses a PROXY protocol (v1 or v2) line and returns the remote IP.
ParseProxyLineV1 parses a PROXY protocol (v1) line and returns the remote IP.
return n such that v <= n and n == 2**i for some i.
Checks that a parameter can be passed as a non-trailing, and returns "*" if it can't.
securely check if a supplied token matches a stored token.
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author

# Variables

slingamn's own private b32 alphabet, removing 1, l, o, and 0.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ServerExitSignals are the signals the server will exit on.
No description provided by the author

# Structs

No description provided by the author
ListenerConfig is all the information about how to process incoming IRC connections on a listener.
No description provided by the author
Once is a fork of sync.Once to expose a Done() method.
ReloadableListener is a wrapper for net.Listener that allows reloading of config data for postprocessing connections (TLS, PROXY protocol, etc.).
SplitMessage represents a message that's been split for sending.
TokenLineBuilder is a helper for building IRC lines composed of delimited tokens, with a maximum line length.
/ WrappedConn is a net.Conn with some additional data stapled to it; the proxied IP, if one was read via the PROXY protocol, and the listener configuration.

# Type aliases

No description provided by the author
Technically a UUIDv4 has version bits set, but this doesn't matter in practice.