Documentation ¶
Overview ¶
Package listeners is a singleton package that keeps track of nostr websockets
Index ¶
- Constants
- Variables
- type L
- type Map
- type T
- func (l *T) GetChallenge(conn *websocket.Conn, req *http.Request, addr string) (ws *web.Socket)
- func (l *T) NotifyListeners(authRequired bo, ev *event.T)
- func (l *T) RemoveListener(ws *web.Socket)
- func (l *T) RemoveListenerId(ws *web.Socket, id st)
- func (l *T) SetListener(id st, ws *web.Socket, ff *filters.T)
Constants ¶
View Source
const ( DefaultChallengeHRP = "nchal" DefaultWriteWait = 10 * time.Second DefaultPongWait = 60 * time.Second DefaultPingPeriod = DefaultPongWait / 2 DefaultMaxMessageSize = 1 * units.Mb DefaultChallengeLength = 16 )
Variables ¶
View Source
var ( NIP20prefixmatcher = regexp.MustCompile(`^\w+: `) Upgrader = websocket.Upgrader{ReadBufferSize: 1024, WriteBufferSize: 1024, CheckOrigin: func(r *http.Request) bo { return true }} )
Functions ¶
This section is empty.
Types ¶
type T ¶
type T struct { sync.Mutex Map ChallengeHRP st WriteWait, PongWait, PingPeriod time.Duration MaxMessageSize int64 ChallengeLength no }
func (*T) GetChallenge ¶
func (*T) NotifyListeners ¶
func (*T) RemoveListener ¶
func (*T) RemoveListenerId ¶
Click to show internal directories.
Click to hide internal directories.