fxmod

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package fxmod integrates nexus with go.uber.org/fx. Add fxmod.Module to your fx.New(...) call; nexus provides *nexus.App into the graph and manages the HTTP server's start/stop via fx.Lifecycle.

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("nexus",
	fx.Provide(NewApp),
	fx.Invoke(registerLifecycle),
)

Module provides *nexus.App plus a managed *http.Server bound to its Gin engine. Inputs expected from the fx graph: Config. Outputs: *nexus.App.

Functions

func NewApp

func NewApp(cfg Config) *nexus.App

NewApp is the fx provider for *nexus.App.

Types

type Config

type Config struct {
	// Addr is the HTTP listen address (default ":8080").
	Addr string

	// DashboardName is the brand shown in the dashboard header and tab title
	// (default "Nexus"). The name is served over /__nexus/config so you can
	// change it per environment without rebuilding the UI.
	DashboardName string

	// TraceCapacity is the ring-buffer size for request traces.
	// 0 disables tracing — the Traces tab will stay empty.
	TraceCapacity int

	// EnableDashboard mounts /__nexus/* if true.
	EnableDashboard bool
}

Config controls how the nexus App is built. Supply it via fx.Supply(cfg) or register a provider that returns it.

Jump to

Keyboard shortcuts

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