camlistore.org: camlistore.org/pkg/webserver/listen Index | Files

package listen

import "camlistore.org/pkg/webserver/listen"

Index

Package Files

listen.go

func Listen Uses

func Listen(addr string) (net.Listener, error)

Listen is a replacement for net.Listen and supports

port, :port, ip:port, FD:<fd_num>, ADDR:<name>

Listeners are always TCP.

func Usage Uses

func Usage(name string) string

Usage returns a descriptive usage message for a flag given the name of thing being addressed.

type Addr Uses

type Addr struct {
    // contains filtered or unexported fields
}

Addr is a flag variable. Use like:

var webPort listen.Addr
flag.Var(&webPort, "web_addr", listen.Usage("Web server address"))
flag.Parse()
webListener, err := webPort.Listen()

func NewFlag Uses

func NewFlag(flagName, defaultValue string, serverType string) *Addr

NewFlag returns a flag that implements the flag.Value interface.

func (*Addr) Listen Uses

func (a *Addr) Listen() (net.Listener, error)

Listen returns the address's TCP listener.

func (*Addr) Set Uses

func (a *Addr) Set(v string) error

Set implements the flag.Value interface.

func (*Addr) String Uses

func (a *Addr) String() string

Package listen imports 7 packages (graph) and is imported by 1 packages. Updated 2018-01-31. Refresh now. Tools for package owners.