Convert socket group to int

Sockets interface has been updated to take in a the group
id as an integer rather than a string.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Derek McGowan 2017-02-07 11:32:39 -08:00 committed by Brian Goff
parent 4f223337a5
commit e5d77c64a2

View file

@ -31,7 +31,12 @@ func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) ([]net.Listene
}
ls = append(ls, l)
case "unix":
l, err := sockets.NewUnixSocket(addr, socketGroup)
gid, err := strconv.Atoi(socketGroup)
if err != nil {
return nil, fmt.Errorf("failed to parse socket group id: should be a number: %v", socketGroup)
}
l, err := sockets.NewUnixSocket(addr, gid)
if err != nil {
return nil, fmt.Errorf("can't create unix socket %s: %v", addr, err)
}