Merge pull request #100 from gtardif/windows_grpc

Allow server to start on tcp port or if windows, named pipe rather than unix socket
This commit is contained in:
Guillaume Tardif 2020-05-18 15:18:51 +02:00 committed by GitHub
commit 2e8251fb2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 55 additions and 5 deletions

View file

@ -2,7 +2,6 @@ package cmd
import (
"context"
"net"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@ -39,10 +38,12 @@ func ServeCommand() *cobra.Command {
func runServe(ctx context.Context, opts serveOpts) error {
s := server.New()
listener, err := net.Listen("unix", opts.address)
listener, err := server.CreateListener(opts.address)
if err != nil {
return errors.Wrap(err, "listen unix socket")
return errors.Wrap(err, "listen address "+opts.address)
}
// nolint errcheck
defer listener.Close()