Skip to main content

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

NameTypeDescription
ctxcontext.ContextThe existing context to which the NodeID will be added or appended.
nodeIDstringThe 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

TypeDescription
context.ContextA new context object with the NodeID value set or appended.