Documentation
¶
Index ¶
- Constants
- Variables
- func GetListener(conn *websocket.Conn, req *http.Request) (w *ws.Listener)
- type A
- func (a *A) HandleAuth(req []byte, srv interfaces.Server) (msg []byte)
- func (a *A) HandleClose(req []byte, srv interfaces.Server) (note []byte)
- func (a *A) HandleEvent(c context.T, req []byte, srv interfaces.Server) (msg []byte)
- func (a *A) HandleMessage(msg []byte)
- func (a *A) HandleReq(c context.T, req []byte, skipEventFunc options.SkipEventFunc, ...) (r []byte)
- func (a *A) Pinger(ctx context.T, ticker *time.Ticker, cancel context.F, s interfaces.Server)
- func (a *A) Serve(w http.ResponseWriter, r *http.Request, s interfaces.Server)
- type Close
- type Map
- type S
- type W
Constants ¶
View Source
const ( DefaultChallengeHRP = "nchal" DefaultChallengeLength = 16 )
View Source
const ( DefaultWriteWait = 10 * time.Second DefaultPongWait = 60 * time.Second DefaultPingWait = DefaultPongWait / 2 DefaultMaxMessageSize = 1 * units.Mb )
View Source
const Type = "socketapi"
Variables ¶
View Source
var (
NIP20prefixmatcher = regexp.MustCompile(`^\w+: `)
)
Functions ¶
Types ¶
type A ¶
func (*A) HandleAuth ¶
func (a *A) HandleAuth(req []byte, srv interfaces.Server) (msg []byte)
func (*A) HandleClose ¶
func (a *A) HandleClose(req []byte, srv interfaces.Server) (note []byte)
func (*A) HandleEvent ¶
func (*A) HandleMessage ¶
func (*A) HandleReq ¶
func (a *A) HandleReq( c context.T, req []byte, skipEventFunc options.SkipEventFunc, srv interfaces.Server) (r []byte)
func (*A) Serve ¶
func (a *A) Serve(w http.ResponseWriter, r *http.Request, s interfaces.Server)
type Map ¶ added in v1.14.3
Map is a map of filters associated with a collection of ws.Listener connections.
type S ¶ added in v1.14.3
type S struct {
// Mx is the mutex for the Map.
Mx sync.Mutex
// Map is the map of subscribers and subscriptions from the websocket api.
Map
}
Click to show internal directories.
Click to hide internal directories.