MCPcopy
hub / github.com/TomWright/dasel / WithExecutorID

Function WithExecutorID

execution/context.go:16–25  ·  view source on GitHub ↗
(ctx context.Context, executorID string)

Source from the content-addressed store, hash-verified

14)
15
16func WithExecutorID(ctx context.Context, executorID string) context.Context {
17 currentPath := ExecutorPath(ctx)
18 newPath := fmt.Sprintf("%s/%s", currentPath, executorID)
19 currentDepth := ExecutorDepth(ctx)
20 newDepth := currentDepth + 1
21 ctx = context.WithValue(ctx, executorIDCtxKey, executorID)
22 ctx = context.WithValue(ctx, executorPathCtxKey, newPath)
23 ctx = context.WithValue(ctx, executorDepthCtxKey, newDepth)
24 return ctx
25}
26
27func ExecutorID(ctx context.Context) string {
28 v, ok := ctx.Value(executorIDCtxKey).(string)

Callers 15

callFnExecutorFunction · 0.85
mapExprExecutorFunction · 0.85
groupByExprExecutorFunction · 0.85
unaryExprExecutorFunction · 0.85
arrayExprExecutorFunction · 0.85
rangeExprExecutorFunction · 0.85
indexExprExecutorFunction · 0.85
mapValuesExprExecutorFunction · 0.85
branchExprExecutorFunction · 0.85
filterExprExecutorFunction · 0.85
allExprExecutorFunction · 0.85
objectExprExecutorFunction · 0.85

Calls 2

ExecutorPathFunction · 0.85
ExecutorDepthFunction · 0.85

Tested by

no test coverage detected