Documentation
¶
Index ¶
- type Api
- func (a *Api) Metrics(w http.ResponseWriter, r *http.Request, p httprouter.Params)
- func (a *Api) Publish(w http.ResponseWriter, r *http.Request, p httprouter.Params)
- func (a *Api) Tail(w http.ResponseWriter, r *http.Request, p httprouter.Params)
- func (a *Api) TailTransform(filterFunc func(msg any) bool, transform ...func(any) any) func(w http.ResponseWriter, r *http.Request, p httprouter.Params)
- func (a *Api) Websocket(appCtx context.Context, originPatterns []string, filterFunc func(msg any) bool, ...) func(w http.ResponseWriter, r *http.Request, p httprouter.Params)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func NewTopicAPI ¶
func (*Api) Metrics ¶
func (a *Api) Metrics(w http.ResponseWriter, r *http.Request, p httprouter.Params)
func (*Api) Publish ¶
func (a *Api) Publish(w http.ResponseWriter, r *http.Request, p httprouter.Params)
http util helper to publish directly for debugging only, only support consumer inside the same process
func (*Api) Tail ¶
func (a *Api) Tail(w http.ResponseWriter, r *http.Request, p httprouter.Params)
http helper to listen notify event; all event will be listened NOTE: interesting that Google chrome: 1. if we not yet press enter, already started the connection. 2. if we open multiple, they do not create new (it seems reusing the old connection?) . WORKAROUND: add random values to the URL param
func (*Api) TailTransform ¶
func (*Api) Websocket ¶
func (a *Api) Websocket(appCtx context.Context, originPatterns []string, filterFunc func(msg any) bool, transform ...func(any) any) func(w http.ResponseWriter, r *http.Request, p httprouter.Params)
originPatterns:
[]string{
"http://localhost:*", "http://localhost",
"https://chat.desain.gratis", "http://dxb-keenan.tailnet-ee99.ts.net",
"https://dxb-keenan.tailnet-ee99.ts.net",
"https://mb.desain.gratis",
}
TODO:: FIX WS IMPLEMENTATION (appCtx)