Documentation
¶
Overview ¶
Package app provides reusable application entrypoints for HTTP and NATS services. Modeled after github.com/InsideGallery/core/app.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NATSMain ¶
func NATSMain(name, monitorAddr string, initSubs InitSubscriptions)
NATSMain is the complete entrypoint for a NATS worker service. It handles: logging → profiler → NATS connect → init closure → signals → wait. Reads NATS_ADDR, NATS_CONCURRENT_SIZE, NATS_READ_TIMEOUT from environment.
func WebMain ¶
func WebMain(name string, cfg *httpserver.Config, initRouter InitRouter)
WebMain is the complete entrypoint for an HTTP service. It handles: logging → profiler → init closure → signals → listen. The caller provides only the service-specific wiring in initRouter.
Types ¶
type InitRouter ¶
InitRouter is a closure that wires service-specific dependencies (DB, auth, etc.) and registers routes on the Fiber app. If it returns nil, all setup succeeded.
type InitSubscriptions ¶
type InitSubscriptions func(ctx context.Context, sub *subscriber.Subscriber) error
InitSubscriptions is a closure that wires service-specific dependencies (DB, etc.) and registers NATS subscriptions. If it returns nil, all setup succeeded.