app

package
v1.2.29 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Unlicense Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MonitorResources

func MonitorResources(c cx)

Types

type Relay

type Relay struct {
	sync.Mutex
	*config.C
	Store store.I
	// Owners' pubkeys. If any are set, C.AuthRequired is implicitly on.
	Owners []by
	// Followed are the relay owners' follows, who are granted access if there is
	// Owners set.
	Followed,

	OwnersFollowed,

	FollowsFollows,

	Muted map[st]struct{}
	// OwnersFollowLists are the event IDs of owners follow lists, which must not be
	// deleted, only replaced. This list includes follow lists of follows, if
	// FollowsFollows is enabled, to extend this same protection to preventing
	// delete of events. kind.FollowList events are protected from deleting in
	// general, and are not deleted when replaced, in order that they remain
	// recoverable.
	OwnersFollowLists []by
	// OwnersMuteLists are the event IDs of owners mute lists, which must not be
	// deleted, only replaced.
	OwnersMuteLists []by
}

Relay is the state for a realy.

func (*Relay) AcceptEvent

func (r *Relay) AcceptEvent(c cx, evt *event.T, hr *http.Request, origin st,
	authedPubkey by) (accept bo, notice st, afterSave func())

func (*Relay) AcceptReq

func (r *Relay) AcceptReq(c cx, hr *http.Request, id by, ff *filters.T,
	authedPubkey by) (allowed *filters.T, ok bo)

func (*Relay) AuthEnabled

func (r *Relay) AuthEnabled() bo

func (*Relay) CheckOwnerLists

func (r *Relay) CheckOwnerLists(c cx)

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 er)

func (*Relay) Name

func (r *Relay) Name() st

func (*Relay) ServiceUrl

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

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(c cx) store.I

Jump to

Keyboard shortcuts

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