WithNodeID
Gets a new context with NodeID (nested) set.
def WithNodeID(
ctx: context.Context,
nodeID: string
) - > context.Context
Gets a new context with NodeID (nested) set. This function is used to associate a unique identifier with a context, allowing for hierarchical tracking of operations or components.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The existing context to which the NodeID will be added or appended. |
| nodeID | string | The identifier to be associated with the context. If an existing NodeID is present in the context, this new ID will be appended to it, forming a nested ID. |
Returns
| Type | Description |
|---|---|
context.Context | A new context object with the NodeID value set or appended. |