endpoints

package
v0.0.0-...-9914b64 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package endpoints serves the API catalog endpoints (`endpoints` / `endpoint`).

upstream の `endpoints.ts` / `endpoint.ts` に対応する。どちらも「この インスタンスがどの endpoint を持つか」を返す introspection なので、 **ルータが自分の登録内容を教える**必要がある。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves the API catalog endpoints.

func NewHandler

func NewHandler(list Lister) *Handler

NewHandler creates a Handler backed by the given endpoint lister.

func (*Handler) Endpoint

func (h *Handler) Endpoint(c *echo.Context) error

Endpoint returns metadata for one endpoint, or null when it is unknown.

POST /api/endpoint

mk-go は per-endpoint の paramDef メタデータを保持しないため、param の 名前と型までは導出できない。response の shape (params は配列) と未知 endpoint の null だけ upstream に揃える (#1695)。

func (*Handler) Endpoints

func (h *Handler) Endpoints(c *echo.Context) error

Endpoints returns every registered endpoint name. POST /api/endpoints

type Lister

type Lister func() []string

Lister returns the names of every registered POST /api/* endpoint ("notes/create" のように `/api/` を落とした形)。

**`*echo.Echo` そのものは受け取らない。** api 層がルータの実体を持つと 依存が逆向きになるので、必要な情報 (名前の一覧) だけを関数で注入する。

Jump to

Keyboard shortcuts

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