You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
437 B

package jsonrpc
import (
"context"
"github.com/intel-go/fastjson"
)
type requestIDKey struct{}
// RequestID takes request id from context.
func RequestID(c context.Context) *fastjson.RawMessage {
return c.Value(requestIDKey{}).(*fastjson.RawMessage)
}
// WithRequestID adds request id to context.
func WithRequestID(c context.Context, id *fastjson.RawMessage) context.Context {
return context.WithValue(c, requestIDKey{}, id)
}