well-goknown/vendor/github.com/fiatjaf/eventstore/negentropy.go

14 lines
305 B
Go
Raw Permalink Normal View History

2024-11-11 19:56:01 +00:00
package eventstore
import "context"
var negentropySessionKey = struct{}{}
func IsNegentropySession(ctx context.Context) bool {
return ctx.Value(negentropySessionKey) != nil
}
func SetNegentropy(ctx context.Context) context.Context {
return context.WithValue(ctx, negentropySessionKey, struct{}{})
}