Commit a9c358f2 by Li Feifei

go fmt project

parent 8d26ca04
...@@ -2,14 +2,14 @@ package gateway ...@@ -2,14 +2,14 @@ package gateway
import ( import (
"context" "context"
beeLogger "github.com/beego/bee/logger"
"net/http" "net/http"
"strings" "strings"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"im-microservice/pb"
_ "im-microservice/google_api" _ "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"
"golang.org/x/net/http2/h2c" "golang.org/x/net/http2/h2c"
"google.golang.org/grpc" "google.golang.org/grpc"
...@@ -37,7 +37,7 @@ func ProvideHTTP(endpoint string, grpcServer *grpc.Server) *http.Server { ...@@ -37,7 +37,7 @@ func ProvideHTTP(endpoint string, grpcServer *grpc.Server) *http.Server {
beeLogger.Log.Success(endpoint + " HTTP.Listing...") beeLogger.Log.Success(endpoint + " HTTP.Listing...")
return &http.Server{ return &http.Server{
Addr: endpoint, Addr: endpoint,
Handler: grpcHandlerFunc( grpcServer, mux), Handler: grpcHandlerFunc(grpcServer, mux),
} }
} }
...@@ -48,10 +48,10 @@ func grpcHandlerFunc(grpcServer *grpc.Server, otherHandler http.Handler) http.Ha ...@@ -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) { return h2c.NewHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Header.Get("Appkey") != "" { if r.Header.Get("Appkey") != "" {
HeaderValues = map[string]string{ HeaderValues = map[string]string{
"Appkey" : r.Header.Get("Appkey"), "Appkey": r.Header.Get("Appkey"),
"Nonce" : r.Header.Get("Nonce"), "Nonce": r.Header.Get("Nonce"),
"Curtime" : r.Header.Get("Curtime"), "Curtime": r.Header.Get("Curtime"),
"Checksum" : r.Header.Get("Checksum"), "Checksum": r.Header.Get("Checksum"),
} }
} }
ctx := context.WithValue(r.Context(), "Header", HeaderValues) ctx := context.WithValue(r.Context(), "Header", HeaderValues)
...@@ -63,5 +63,3 @@ func grpcHandlerFunc(grpcServer *grpc.Server, otherHandler http.Handler) http.Ha ...@@ -63,5 +63,3 @@ func grpcHandlerFunc(grpcServer *grpc.Server, otherHandler http.Handler) http.Ha
}), &http2.Server{}) }), &http2.Server{})
} }
...@@ -51,7 +51,6 @@ func checksum(req map[string]string) error { ...@@ -51,7 +51,6 @@ func checksum(req map[string]string) error {
return nil return nil
} }
func Auth(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, func Auth(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo,
handler grpc.UnaryHandler) (interface{}, error) { handler grpc.UnaryHandler) (interface{}, error) {
......
...@@ -106,7 +106,6 @@ func (us *UserRelationshipService) ListBlackAndMuteList(ctx context.Context, ...@@ -106,7 +106,6 @@ func (us *UserRelationshipService) ListBlackAndMuteList(ctx context.Context,
return return
} }
blacklist, mutelist, err := ListBlackAndMuteListDB(in) blacklist, mutelist, err := ListBlackAndMuteListDB(in)
if err != nil { if err != nil {
err = status.Error(codes.Internal, err.Error()) 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