api

package
v0.0.0-...-3fc2642 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 NewTopicAPI(topic notifier.Topic) *Api

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 (a *Api) TailTransform(filterFunc func(msg any) bool, transform ...func(any) any) func(w http.ResponseWriter, r *http.Request, p httprouter.Params)

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)

Jump to

Keyboard shortcuts

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