api

package
v0.0.0-...-2c9f6af Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package api wires the gin engine: middleware, route groups, and handler registration. Feature handlers register their own routes via Register* funcs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(db *gorm.DB, cfg *config.Config, authSvc *service.AuthService, sysCfg *service.SystemConfigService, srv *http.Server) *gin.Engine

NewRouter builds the gin engine with global middleware and a /health probe. Route groups are registered by feature packages via their Register funcs. sysCfg is the single shared SystemConfigService instance; it is reused for the CORS middleware, billing (alipay) and the admin system-config endpoints so that the in-memory cache stays coherent (an admin PUT refreshes every reader). srv is the live *http.Server; the system-config handler hot-applies server read/write timeouts to it on save.

Types

This section is empty.

Directories

Path Synopsis
Package handler contains the gin HTTP handlers, organized by feature.
Package handler contains the gin HTTP handlers, organized by feature.

Jump to

Keyboard shortcuts

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