Commit a9c358f2 by Li Feifei

go fmt project

parent 8d26ca04
......@@ -2,14 +2,14 @@ package gateway
import (
"context"
beeLogger "github.com/beego/bee/logger"
"net/http"
"strings"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"im-microservice/pb"
_ "im-microservice/google_api"
"im-microservice/pb"
beeLogger "github.com/beego/bee/logger"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
"google.golang.org/grpc"
......@@ -37,7 +37,7 @@ func ProvideHTTP(endpoint string, grpcServer *grpc.Server) *http.Server {
beeLogger.Log.Success(endpoint + " HTTP.Listing...")
return &http.Server{
Addr: endpoint,
Handler: grpcHandlerFunc( grpcServer, mux),
Handler: grpcHandlerFunc(grpcServer, mux),
}
}
......@@ -48,10 +48,10 @@ func grpcHandlerFunc(grpcServer *grpc.Server, otherHandler http.Handler) http.Ha
return h2c.NewHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Header.Get("Appkey") != "" {
HeaderValues = map[string]string{
"Appkey" : r.Header.Get("Appkey"),
"Nonce" : r.Header.Get("Nonce"),
"Curtime" : r.Header.Get("Curtime"),
"Checksum" : r.Header.Get("Checksum"),
"Appkey": r.Header.Get("Appkey"),
"Nonce": r.Header.Get("Nonce"),
"Curtime": r.Header.Get("Curtime"),
"Checksum": r.Header.Get("Checksum"),
}
}
ctx := context.WithValue(r.Context(), "Header", HeaderValues)
......@@ -63,5 +63,3 @@ func grpcHandlerFunc(grpcServer *grpc.Server, otherHandler http.Handler) http.Ha
}), &http2.Server{})
}
......@@ -51,7 +51,6 @@ func checksum(req map[string]string) error {
return nil
}
func Auth(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo,
handler grpc.UnaryHandler) (interface{}, error) {
......
......@@ -106,7 +106,6 @@ func (us *UserRelationshipService) ListBlackAndMuteList(ctx context.Context,
return
}
blacklist, mutelist, err := ListBlackAndMuteListDB(in)
if err != nil {
err = status.Error(codes.Internal, err.Error())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment