zrepl/cmd/config_serve_tcp.go
2018-08-27 15:22:32 +02:00

27 lines
480 B
Go

package cmd
import (
"net"
"time"
"github.com/zrepl/zrepl/cmd/config"
)
type TCPListenerFactory struct {
Address string
}
func parseTCPListenerFactory(c config.Global, in config.TCPServe) (*TCPListenerFactory, error) {
lf := &TCPListenerFactory{
Address: in.Listen,
}
return lf, nil
}
var TCPListenerHandshakeTimeout = 10 * time.Second // FIXME make configurable
func (f *TCPListenerFactory) Listen() (net.Listener, error) {
return net.Listen("tcp", f.Address)
}