mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-09-15 21:00:27 +00:00
15 lines
363 B
Go
15 lines
363 B
Go
package httpclient
|
|
|
|
import "context"
|
|
|
|
type transportKey struct{}
|
|
|
|
func contextWithTransportTag(ctx context.Context, transportTag string) context.Context {
|
|
return context.WithValue(ctx, transportKey{}, transportTag)
|
|
}
|
|
|
|
func transportTagFromContext(ctx context.Context) (string, bool) {
|
|
value, loaded := ctx.Value(transportKey{}).(string)
|
|
return value, loaded
|
|
}
|