Files
xinmi/internal/knowledgeversion/context.go
T

10 lines
346 B
Go
Raw Normal View History

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 }