Documentation
¶
Index ¶
- func AllListeners() ([]net.Listener, error)
- func NewListener() (net.Listener, error)
- func NewListenerOn(t ListenTarget) (net.Listener, error)
- func NewListenerOrDefault(proto, defaultBindAddress string) (net.Listener, error)
- func NewListenersOn(list []ListenTarget) ([]net.Listener, error)
- type ListenTarget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllListeners ¶
AllListeners creates new listeners from SERVER_STARTER_PORT environment variable.
This binds to ALL file descriptors in SERVER_STARTER_PORT
func NewListener ¶
NewListener creates a new listener from SERVER_STARTER_PORT environment variable
Note that this binds to only ONE file descriptor. If multiple ports are specified in the environment variable, the first one is used
func NewListenerOn ¶
func NewListenerOn(t ListenTarget) (net.Listener, error)
NewListenerOn creates a listener for given ListenTarget
func NewListenerOrDefault ¶
NewListenerOrDefault creates a new listener from SERVER_STARTER_PORT, or if that fails, binds to the "default" bind address
func NewListenersOn ¶
func NewListenersOn(list []ListenTarget) ([]net.Listener, error)
NewListenersOn creates listeners for each ListenTarget given
Types ¶
type ListenTarget ¶
type ListenTarget struct {
Name string // host:port | port. Currently unix sockets are not supported
Fd uintptr
}
ListenTarget describes an address and an associated file descriptor
func ParsePorts ¶
func ParsePorts(ssport string) ([]ListenTarget, error)
ParsePorts parses the given string and returns a list of ListenTarget structs that can be passed to NewListenerOn()
func Ports ¶
func Ports() ([]ListenTarget, error)
Ports parses SERVER_STARTER_PORT environment variable, and returns a list of ListenTarget structs that can be passed to NewListenerOn()