github.com/newrelic/go-agent@v3.26.0+incompatible/internal/context.go (about)

     1  // Copyright 2020 New Relic Corporation. All rights reserved.
     2  // SPDX-License-Identifier: Apache-2.0
     3  
     4  package internal
     5  
     6  type contextKeyType struct{}
     7  
     8  var (
     9  	// TransactionContextKey is the key used for newrelic.FromContext and
    10  	// newrelic.NewContext.
    11  	TransactionContextKey = contextKeyType(struct{}{})
    12  
    13  	// GinTransactionContextKey is used as the context key in
    14  	// nrgin.Middleware and nrgin.Transaction.  Unfortunately, Gin requires
    15  	// a string context key. We use two different context keys (and check
    16  	// both in nrgin.Transaction and newrelic.FromContext) rather than use a
    17  	// single string key because context.WithValue will fail golint if used
    18  	// with a string key.
    19  	GinTransactionContextKey = "newRelicTransaction"
    20  )