routes

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package routes 统一路由注册表:全项目业务 API 的唯一入口。 运行时适配器(internal/server)与文档生成器(internal/openapi)都从 All() 取数, 新增接口只需:1) 在 app/handlers 写统一 Handler,2) 在 All() 注册一行。

分组约定(树形):

  • 组内 Route.Path 为相对组前缀的路径(列表路由用 "" 表示组根)
  • 组 Middlewares 沿树向子组继承(运行时与文档生成行为一致)
  • 中间件函数名即文档标识:文档钩子在 main_doc.go 按函数引用注册(可选)

Index

Constants

View Source
const BasePath = "/api"

BasePath API 统一前缀

Variables

This section is empty.

Functions

func All

func All() []*contract.Group

All 全部业务路由。 约定:无 body 的请求 B=any;无 query/path 入参的请求 Q=NoReq。

Types

This section is empty.

Jump to

Keyboard shortcuts

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