route

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package route holds the shared logic every framework adapter uses to turn a (method, path) route into an ir.Operation. Adapters differ only in how they enumerate routes and in their path-parameter syntax; everything downstream of that is identical, so it lives here once.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColonToBrace

func ColonToBrace(p string) string

ColonToBrace converts router-style path params (":id", "*filepath") into the OpenAPI "{id}" form used by the IR. gin, echo and fiber all use the colon/star syntax; chi already uses braces and skips this.

func FromTemplate

func FromTemplate(method, tmpl string) ir.Operation

FromTemplate builds an ir.Operation from an HTTP method and an OpenAPI-style templated path such as "/users/{id}". Each "{name}" segment becomes a required string path parameter. Routers carry no body/query schema, so those are left empty for a schema provider (M4) to enrich later.

func StandardMethod

func StandardMethod(m string) bool

StandardMethod reports whether m is an HTTP verb worth exposing as a tool (filters out router-internal entries and the rarely-useful TRACE/CONNECT).

Types

This section is empty.

Jump to

Keyboard shortcuts

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