Documentation
¶
Index ¶
- func ApplyConfigOverrides(configPath string, overrides map[string]any) error
- func PatchConfigWithRegistration(configPath string, reg any, ...) error
- func ProcessAlive(pid int) bool
- func ProcessAliveFromPIDFile(path string) (bool, int)
- func PromptLine(label string) (string, error)
- func SetPath(root map[string]any, parts []string, value any)
- func StartBridge(exe string, args []string, workDir, logPath, pidPath string) error
- func StartBridgeFromConfig(exe string, args []string, configPath, logPath, pidPath string) error
- func StopByPIDFile(pidPath string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyConfigOverrides ¶
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 ¶
ProcessAlive checks whether a process with the given PID is running by sending signal 0.
func ProcessAliveFromPIDFile ¶
ProcessAliveFromPIDFile reads a PID from the given file and checks whether the corresponding process is running.
func PromptLine ¶
PromptLine prints label to stdout and reads a single trimmed line from stdin.
func SetPath ¶
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 ¶
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 ¶
StartBridgeFromConfig is a convenience wrapper around StartBridge that derives the working directory from the config path.
func StopByPIDFile ¶
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.