diff --git a/grpcdb/client.go b/grpcdb/client.go index 07fd461ec..bae38b1c5 100644 --- a/grpcdb/client.go +++ b/grpcdb/client.go @@ -17,7 +17,7 @@ const ( // NewClient creates a gRPC client connected to the bound gRPC server at serverAddr. // Use kind to set the level of security to either Secure or Insecure. -func NewClient(serverAddr string, serverCert string) (protodb.DBClient, error) { +func NewClient(serverAddr, serverCert string) (protodb.DBClient, error) { creds, err := credentials.NewClientTLSFromFile(serverCert, "") if err != nil { return nil, err diff --git a/grpcdb/doc.go b/grpcdb/doc.go index c92de82d3..0d8e380ce 100644 --- a/grpcdb/doc.go +++ b/grpcdb/doc.go @@ -21,8 +21,8 @@ should use it, for functionality such as: or addr := ":8998" - cert := "server.crt" - key := "server.key" + cert := "server.crt" + key := "server.key" go func() { if err := grpcdb.ListenAndServe(addr, cert, key); err != nil { log.Fatalf("BindServer: %v", err) diff --git a/grpcdb/server.go b/grpcdb/server.go index d8dc1581f..9b00be43f 100644 --- a/grpcdb/server.go +++ b/grpcdb/server.go @@ -16,7 +16,7 @@ import ( // ListenAndServe is a blocking function that sets up a gRPC based // server at the address supplied, with the gRPC options passed in. // Normally in usage, invoke it in a goroutine like you would for http.ListenAndServe. -func ListenAndServe(addr string, cert string, key string, opts ...grpc.ServerOption) error { +func ListenAndServe(addr, cert, key string, opts ...grpc.ServerOption) error { ln, err := net.Listen("tcp", addr) if err != nil { return err @@ -28,7 +28,7 @@ func ListenAndServe(addr string, cert string, key string, opts ...grpc.ServerOpt return srv.Serve(ln) } -func NewServer(cert string, key string, opts ...grpc.ServerOption) (*grpc.Server, error) { +func NewServer(cert, key string, opts ...grpc.ServerOption) (*grpc.Server, error) { creds, err := credentials.NewServerTLSFromFile(cert, key) if err != nil { return nil, err