|
@@ -15,7 +15,6 @@ const (
|
|
|
sockoptSessionKey
|
|
sockoptSessionKey
|
|
|
trackedConnectionErrorKey
|
|
trackedConnectionErrorKey
|
|
|
handlerSessionKey
|
|
handlerSessionKey
|
|
|
- environmentKey
|
|
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// ContextWithID returns a new context with the given ID.
|
|
// ContextWithID returns a new context with the given ID.
|
|
@@ -134,14 +133,3 @@ func SubmitOutboundErrorToOriginator(ctx context.Context, err error) {
|
|
|
func TrackedConnectionError(ctx context.Context, tracker TrackedRequestErrorFeedback) context.Context {
|
|
func TrackedConnectionError(ctx context.Context, tracker TrackedRequestErrorFeedback) context.Context {
|
|
|
return context.WithValue(ctx, trackedConnectionErrorKey, tracker)
|
|
return context.WithValue(ctx, trackedConnectionErrorKey, tracker)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-func ContextWithEnvironment(ctx context.Context, environment interface{}) context.Context {
|
|
|
|
|
- return context.WithValue(ctx, environmentKey, environment)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-func EnvironmentFromContext(ctx context.Context) interface{} {
|
|
|
|
|
- if environment, ok := ctx.Value(environmentKey).(interface{}); ok {
|
|
|
|
|
- return environment
|
|
|
|
|
- }
|
|
|
|
|
- return nil
|
|
|
|
|
-}
|
|
|