ss

package module
v0.0.0-...-00dd685 Latest Latest
Warning

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

Go to latest
Published: May 7, 2015 License: MIT Imports: 5 Imported by: 10

README

go-server-starter-listener

You want to be looking at github.com/lestrrat/go-server-starter/listener

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllListeners

func AllListeners() ([]net.Listener, error)

AllListeners creates new listeners from SERVER_STARTER_PORT environment variable.

This binds to ALL file descriptors in SERVER_STARTER_PORT

func NewListener

func NewListener() (net.Listener, error)

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

func NewListenerOrDefault(proto, defaultBindAddress string) (net.Listener, error)

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()

Jump to

Keyboard shortcuts

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