Inject constructs a Baggage object and injects it into the provided context under the default context key. Use the returned context for all further operations. The returned Data can be queried at any point for metadata collected over the life of the context.
(ctx context.Context)
| 236 | // operations. The returned Data can be queried at any point for metadata |
| 237 | // collected over the life of the context. |
| 238 | func Inject(ctx context.Context) (*Baggage, context.Context) { |
| 239 | return DefaultMetadata.Inject(ctx) |
| 240 | } |
| 241 | |
| 242 | // GetBaggage returns the default Baggage stored in the context. |
| 243 | func GetBaggage(ctx context.Context) *Baggage { |