interceptors: add ban

health: set services serving on start and not available on close

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2022-09-27 17:06:18 +02:00
parent 9bf4e691ce
commit c7096975b1
13 changed files with 350 additions and 22 deletions

View File

@ -1,6 +1,8 @@
package interceptors
import (
"context"
"google.golang.org/grpc"
)
@ -18,3 +20,16 @@ type Interceptors interface {
ServerInterceptors
ClientInterceptors
}
func NewContextServerStream(ctx context.Context, ss grpc.ServerStream) grpc.ServerStream {
return &ContextWrapper{ServerStream: ss, ctx: ctx}
}
type ContextWrapper struct {
grpc.ServerStream
ctx context.Context
}
func (w *ContextWrapper) Context() context.Context {
return w.ctx
}