(ctx context.Context, executorID string)
| 14 | ) |
| 15 | |
| 16 | func 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 | |
| 27 | func ExecutorID(ctx context.Context) string { |
| 28 | v, ok := ctx.Value(executorIDCtxKey).(string) |
no test coverage detected