10 lines
346 B
Go
10 lines
346 B
Go
package knowledgeversion
|
|||
|
|
|
||
|
|
import "context"
|
||
|
|
|
||
|
|
type workerKey struct{}
|
||
|
|
|
||
|
|
// WithWorker is used only by the durable version worker, never by HTTP input.
|
||
|
|
func WithWorker(ctx context.Context) context.Context { return context.WithValue(ctx, workerKey{}, true) }
|
||
|
|
func IsWorker(ctx context.Context) bool { v, _ := ctx.Value(workerKey{}).(bool); return v }
|