app

package
v1.2.26 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 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 context.T)

Types

type B added in v1.0.5

type B = []byte

type Ctx added in v1.0.5

type Ctx = context.T

type E added in v1.0.5

type E = error

type N added in v1.0.5

type N = int

type Relay

type Relay struct {
	sync.Mutex
	*config.C
	Store store.I
	// Owners' pubkeys
	Owners                          []B
	Followed, OwnersFollowed, Muted map[S]struct{}
	// OwnersFollowLists are the event IDs of owners follow lists, which must not be deleted, only
	// replaced.
	OwnersFollowLists []B
	// OwnersMuteLists are the event IDs of owners mute lists, which must not be deleted, only
	// replaced.
	OwnersMuteLists []B
}

func (*Relay) AcceptEvent

func (r *Relay) AcceptEvent(c context.T, evt *event.T, hr *http.Request, origin S,
	authedPubkey B) (accept bool, notice S, afterSave func())

func (*Relay) AcceptReq

func (r *Relay) AcceptReq(c Ctx, hr *http.Request, id B, ff *filters.T,
	authedPubkey B) (allowed *filters.T, ok 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 E)

func (*Relay) Name

func (r *Relay) Name() S

func (*Relay) ServiceUrl

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

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 context.T) store.I

type S added in v1.0.5

type S = string

Jump to

Keyboard shortcuts

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