bridgeutil

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyConfigOverrides

func ApplyConfigOverrides(configPath string, overrides map[string]any) error

ApplyConfigOverrides reads a YAML config file at configPath, applies the given dot-separated key overrides, and writes the result back.

func PatchConfigWithRegistration

func PatchConfigWithRegistration(configPath string, reg any, homeserverURL, bridgeName, bridgeType, dbName, beeperDomain, asToken, userID, matrixToken, provisioningSecret string) error

PatchConfigWithRegistration applies the standard Beeper self-hosted bridge configuration to the YAML config file at configPath. It merges homeserver, appservice, bridge, database, matrix, provisioning, encryption and other sections required for websocket-mode operation against hungryserv.

func ProcessAlive

func ProcessAlive(pid int) bool

ProcessAlive checks whether a process with the given PID is running by sending signal 0.

func ProcessAliveFromPIDFile

func ProcessAliveFromPIDFile(path string) (bool, int)

ProcessAliveFromPIDFile reads a PID from the given file and checks whether the corresponding process is running.

func PromptLine

func PromptLine(label string) (string, error)

PromptLine prints label to stdout and reads a single trimmed line from stdin.

func SetPath

func SetPath(root map[string]any, parts []string, value any)

SetPath sets a nested value inside a map[string]any tree, creating intermediate maps as needed. For example, SetPath(doc, ["a","b","c"], 42) ensures doc["a"]["b"]["c"] == 42.

func StartBridge

func StartBridge(exe string, args []string, workDir, logPath, pidPath string) error

StartBridge launches a bridge process in the background, redirecting its stdout and stderr to logPath. The process PID is written to pidPath. The command is specified as the executable path plus any additional arguments (e.g., "-c", configPath).

func StartBridgeFromConfig

func StartBridgeFromConfig(exe string, args []string, configPath, logPath, pidPath string) error

StartBridgeFromConfig is a convenience wrapper around StartBridge that derives the working directory from the config path.

func StopByPIDFile

func StopByPIDFile(pidPath string) (bool, error)

StopByPIDFile reads a PID from pidPath, sends SIGTERM to the process, waits up to 5 seconds for it to exit, then sends SIGKILL if needed. Returns true if the process was running and was stopped.

Types

This section is empty.

Jump to

Keyboard shortcuts

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