Documentation ¶
Index ¶
- Variables
- func FromContext(ctx context.Context) string
- func HandleRequestID(ctx context.Context, validator requestIDValidator) string
- func HandleRequestIDChain(ctx context.Context, validator requestIDValidator) string
- func StreamServerInterceptor(opt ...Option) grpc.StreamServerInterceptor
- func UnaryServerInterceptor(opt ...Option) grpc.UnaryServerInterceptor
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultXRequestIDKey = "x-request-id"
DefaultXRequestIDKey is metadata key name for request ID
Functions ¶
func FromContext ¶
func HandleRequestID ¶
func HandleRequestIDChain ¶
func StreamServerInterceptor ¶
func StreamServerInterceptor(opt ...Option) grpc.StreamServerInterceptor
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(opt ...Option) grpc.UnaryServerInterceptor
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func ChainRequestID ¶
func ChainRequestID() Option
func RequestIDValidator ¶
func RequestIDValidator(validator requestIDValidator) Option
RequestIDValidator is validator function that returns true if request id is valid, or false if invalid.
Click to show internal directories.
Click to hide internal directories.