eventhandler

package
v4.0.0-...-6e01468 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(c *config.Config) error

Setup configures the Handler.

Types

type Handler

type Handler struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Handler provides event handling.

func Get

func Get() *Handler

Get returns the Handler.

func NewHandler

func NewHandler(opts HandlerOptions) (*Handler, error)

NewHandler creates a new Handler.

func (*Handler) RegisterUplinkEventFunc

func (h *Handler) RegisterUplinkEventFunc(id uuid.UUID, f func(context.Context, integration.UplinkEvent) error)

RegisterUplinkEventFunc registers the given function to handle uplink events. Multiple functions can be registered simultaneously.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

func (*Handler) UnregisterUplinkEventFunc

func (h *Handler) UnregisterUplinkEventFunc(id uuid.UUID)

UnregisterUplinkEventFunc removes the function to handle uplink events.

type HandlerOptions

type HandlerOptions struct {
	// JSON indicates if the events are in JSON format. When left to false
	// Protobuf is expected.
	JSON bool
}

Jump to

Keyboard shortcuts

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