app

package
v1.9.10 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: Unlicense Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MonitorResources

func MonitorResources(c context.T)

Types

type List added in v1.7.5

type List map[string]struct{}

type Relay

type Relay struct {
	sync.Mutex
	*config.C
	Store store.I

	// Followed are the pubkeys that are in the Owners' follow lists and have full
	// access permission.
	Followed List
	// OwnersFollowed are "guests" of the Followed and have full access but with
	// rate limiting enabled.
	OwnersFollowed List
	// Muted are on Owners' mute lists and do not have write access to the relay,
	// even if they would be in the OwnersFollowed list, they can only read.
	Muted List
	// OwnersFollowLists are the event IDs of owners follow lists, which must not be
	// deleted, only replaced.
	OwnersFollowLists [][]byte
	// OwnersMuteLists are the event IDs of owners mute lists, which must not be
	// deleted, only replaced.
	OwnersMuteLists [][]byte
	// contains filtered or unexported fields
}

func (*Relay) AcceptEvent

func (r *Relay) AcceptEvent(c context.T, evt *event.T, hr *http.Request,
	origin string, authedPubkey []byte) (accept bool, notice string, afterSave func())

func (*Relay) AcceptReq

func (r *Relay) AcceptReq(c context.T, hr *http.Request, id []byte, ff *filters.T,
	authedPubkey []byte) (allowed *filters.T, ok bool, modified bool)

func (*Relay) AuthEnabled

func (r *Relay) AuthEnabled() bool

func (*Relay) CheckOwnerLists

func (r *Relay) CheckOwnerLists(c context.T)

CheckOwnerLists regenerates the owner follow and mute lists if they are empty.

It also adds the followed npubs of the follows.

func (*Relay) Init

func (r *Relay) Init() (err error)

func (*Relay) Name

func (r *Relay) Name() string

func (*Relay) NoLimiter added in v1.7.5

func (r *Relay) NoLimiter(pubKey []byte) (ok bool)

func (*Relay) Owners

func (r *Relay) Owners() [][]byte

func (*Relay) ServiceUrl

func (r *Relay) ServiceUrl(req *http.Request) (s string)

ServiceUrl returns the address of the relay to send back in auth responses. If auth is disabled this returns an empty string.

func (*Relay) Storage

func (r *Relay) Storage() store.I

func (*Relay) ZeroLists

func (r *Relay) ZeroLists()

Jump to

Keyboard shortcuts

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