paywall

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Unlicense Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Handler = &MuxHandler{}
)
View Source
var References []PaywallReference

Functions

func CanRead

func CanRead(author, reader nostr.PubKey) bool

CanRead checks if a reader can access an author's paywalled content

func Init

func Init(relay *khatru.Relay)

func IsReferenced

func IsReferenced(event nostr.Event) bool

func RecomputeMemberPaywall

func RecomputeMemberPaywall(ctx context.Context, member nostr.PubKey)

RecomputeMemberPaywall rebuilds paywall access map for a given user by reading all their kind:1163 events and collecting "p" tags It also reads "a" tags to build filters for referenced events

func ReferencedBy

func ReferencedBy(event nostr.Event) iter.Seq[nostr.PubKey]

Types

type MuxHandler

type MuxHandler struct {
	// contains filtered or unexported fields
}

func (*MuxHandler) ServeHTTP

func (mh *MuxHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type PaywallReference

type PaywallReference struct {
	// the pyramid member who referenced this for their paywall
	Member nostr.PubKey

	// taken from the "a" tag in the kind:1163 from Member, could be anything
	PublicKey  nostr.PubKey
	Kind       nostr.Kind
	Identifier string
}

PaywallReference associates an addressable or replaceable event from a kind:1163 event from Author with a a filter such that when such replaceable event is updated we know to react.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL