paywall

package
v1.0.28 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: Unlicense Imports: 10 Imported by: 0

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