schnutibox/internal/grpcclient/grpcclient.go
Marvin Preuss 63a16a3253
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone Build was killed
modifies the command line interface handling / timer work
2021-08-09 10:49:04 +02:00

19 lines
338 B
Go

package grpcclient
import (
"fmt"
"google.golang.org/grpc"
)
func Conn(hostname string, port int) (*grpc.ClientConn, error) {
var conn *grpc.ClientConn
conn, err := grpc.Dial(fmt.Sprintf("%s:%d", hostname, port), grpc.WithInsecure())
if err != nil {
return nil, fmt.Errorf("could not connect: %w", err)
}
return conn, nil
}