add auth
This commit is contained in:
1 parent
4a17c75d6f
commit
f7a7b19275
25 files changed
+1383
-3
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package interceptor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type LoggerInterceptor struct{}
|
||||
|
||||
func NewLoggerInterceptor() *LoggerInterceptor {
|
||||
return &LoggerInterceptor{}
|
||||
}
|
||||
|
||||
func (li *LoggerInterceptor) UnaryServerInterceptor(
|
||||
ctx context.Context,
|
||||
req interface{},
|
||||
info *grpc.UnaryServerInfo,
|
||||
handler grpc.UnaryHandler,
|
||||
) (interface{}, error) {
|
||||
log.Printf("gRPC call: %s", info.FullMethod)
|
||||
return handler(ctx, req)
|
||||
}
|
||||
Reference in new issue
Block a user