events

package
v0.1.32 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Config    *config.Config
	Broadcast *broadcast.Relay[apievents.Event]
}

func NewHandler

func NewHandler(cfg *config.Config, broadcast *broadcast.Relay[apievents.Event]) *Handler

func (*Handler) HTMXEvents

func (handler *Handler) HTMXEvents(rw http.ResponseWriter, r *http.Request)

func (*Handler) JSONEvents

func (handler *Handler) JSONEvents(rw http.ResponseWriter, r *http.Request)

func (*Handler) Route

func (handler *Handler) Route(router chi.Router)

func (*Handler) SimpleEvents

func (handler *Handler) SimpleEvents(rw http.ResponseWriter, r *http.Request)

SimpleEvents is a simple event stream for the purpose of notification that something did happen. Not what the content of the event is.

Useful for simple notification whose client just need to know that something happened and do something that does not require the content of the event, like refreshing the list by calling another http request.

func (*Handler) Subscribe

func (handler *Handler) Subscribe() (<-chan apievents.Event, func())

Jump to

Keyboard shortcuts

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