Documentation
¶
Overview ¶
Package listener provides functions for creating net.Listeners
Index ¶
- func CloseAll(listeners []net.Listener)
- func MultiListener(listeners ...net.Listener) net.Listener
- func Open(spec string) (net.Listener, error)
- func OpenAll(specs []string) ([]net.Listener, error)
- func OpenJSON(spec map[string]interface{}) (net.Listener, error)
- func RegisterListenerType(name string, openListener OpenListenerFunc)
- type OpenListenerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MultiListener ¶ added in v0.6.0
Create a net.Listener that aggregates the provided listeners. Calling Accept() returns the next available connection among all the listeners. Calling Close() closes each of the listeners, and causes blocked Accept calls to return with net.ErrClosed. Addr() returns a placeholder address that is probably not useful.
func OpenAll ¶
Open all of the listeners specified in specs (using string notation). If any listener fails to open, an error is returned, and none of the listeners are left open.
func OpenJSON ¶
Experimental: Open a listener with the given JSON notation. Note that numbers in spec must be represented using json.Number.
func RegisterListenerType ¶
func RegisterListenerType(name string, openListener OpenListenerFunc)
RegisterListenerType makes a listener type available by the provided name. Use this function to extend go-listener with your own custom listener types. See the documentation for OpenListenerFunc for details.
If RegisterListenerType is called twice with the same name or if openListener is nil, it panics.
Types ¶
type OpenListenerFunc ¶
A function that is called by Open or OpenJSON to create a net.Listener of a particular type. If called by Open, then the first argument is nil, and the second argument is the string passed to Open, with the listener type and colon character removed. If called by OpenJSON, the first argument is the JSON object passed to OpenJSON, and the second argument is empty.
You only need to care about this if you are extending go-listener with your own custom listener types using RegisterListenerType.
Directories
¶
Path | Synopsis |
---|---|
Package cert provides helper functions for working with TLS certificates.
|
Package cert provides helper functions for working with TLS certificates. |
Package proxy implements version 2 of the PROXY protocol (https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)
|
Package proxy implements version 2 of the PROXY protocol (https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) |
Package tls adds support for TLS listeners to src.agwa.name/go-listener.
|
Package tls adds support for TLS listeners to src.agwa.name/go-listener. |
Package tlsutil provides helper functions for working with TLS.
|
Package tlsutil provides helper functions for working with TLS. |
Package unix implements a net.Listener for UNIX domain sockets.
|
Package unix implements a net.Listener for UNIX domain sockets. |