EdgexAgent/device-gps-go/internal/controller/http/correlation/handler.go

22 lines
373 B
Go
Raw Normal View History

2025-07-10 20:30:06 +08:00
// -*- Mode: Go; indent-tabs-mode: t -*-
//
// Copyright (C) 2019-2021 IOTech Ltd
//
// SPDX-License-Identifier: Apache-2.0
package correlation
import (
"context"
"github.com/edgexfoundry/go-mod-core-contracts/v4/common"
)
func IdFromContext(ctx context.Context) string {
hdr, ok := ctx.Value(common.CorrelationHeader).(string)
if !ok {
hdr = ""
}
return hdr
}