notify

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package notify provides a simple HTTP-based event notifier. Used by backend services to push real-time events to a WebSocket gateway.

Usage:

notify.Init("http://mf-ws:9020")
notify.Send("env", map[string]any{"action":"created","env_id":123,"workspace_id":1})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(wsBaseURL string)

Init initializes the global notifier. wsBaseURL is the target's internal API base URL, e.g. "http://mf-ws:9020".

func Send

func Send(resource string, payload any)

Send posts an event to /internal/notify/{resource}. payload is JSON-serialized and sent as the request body.

func SendContext

func SendContext(ctx context.Context, resource string, payload any)

SendContext is like Send but accepts a context for traceId propagation.

Types

type Notifier

type Notifier struct {
	// contains filtered or unexported fields
}

Notifier sends events to a target service via HTTP POST.

Jump to

Keyboard shortcuts

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