fix server.go
This commit is contained in:
@@ -5,18 +5,12 @@ var NewFile = `
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
{import}
|
{import}
|
||||||
"git.apinb.com/bsm-sdk/core/vars"
|
"context"
|
||||||
"google.golang.org/grpc"
|
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
|
||||||
"google.golang.org/grpc/reflection"
|
|
||||||
"google.golang.org/protobuf/proto"
|
|
||||||
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
"google.golang.org/grpc/reflection"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
@@ -30,7 +24,6 @@ func New(addr string) *Server {
|
|||||||
srv := &Server{
|
srv := &Server{
|
||||||
Ctx: context.Background(),
|
Ctx: context.Background(),
|
||||||
Grpc: grpc.NewServer(),
|
Grpc: grpc.NewServer(),
|
||||||
Mux: gwRuntime.NewServeMux(gwRuntime.WithForwardResponseRewriter(responseEnvelope)),
|
|
||||||
grpcConns: make(map[string]*grpc.ClientConn),
|
grpcConns: make(map[string]*grpc.ClientConn),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user