Documentation ¶
Index ¶
Constants ¶
View Source
const ContextKeyHexaCtx = "__hexa_ctx__"
ContextKeyHexaCtx is the identifier to set the hexa context as a field in the context of a gRPC method.
Variables ¶
View Source
var (
ErrInvalidHexaContextPayload = status.Error(codes.Internal, "invalid hexa context payload provided to json marshaller")
)
Functions ¶
Types ¶
type HexaContextInterceptor ¶
type HexaContextInterceptor struct {
// contains filtered or unexported fields
}
HexaContextInterceptor is the gRPC interceptor to pass hexa context through gRPC. Note: we do not provide stream interceptors, if you think need it, create PR or issue.
func NewHexaContextInterceptor ¶
func NewHexaContextInterceptor(cei hexa.ContextExporterImporter) *HexaContextInterceptor
NewHexaContextInterceptor returns new instance of the HexaContextInterceptor.
func (*HexaContextInterceptor) UnaryClientInterceptor ¶
func (ci *HexaContextInterceptor) UnaryClientInterceptor(ctx context.Context, method string, req interface{}, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
func (*HexaContextInterceptor) UnaryServerInterceptor ¶
func (ci *HexaContextInterceptor) UnaryServerInterceptor(c context.Context, req interface{}, info *grpc.UnaryServerInfo, h grpc.UnaryHandler) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.