greet

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 10 Imported by: ? 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 greet 是示例提供方模块,演示业务域模块的标准形态: Provide 契约实现供同进程消费方 Resolve,Mount 自己的 HTTP 路由。 真实域 repo 中实现全部在 internal/,对外只导出 Module()。

Index

Constants

View Source
const Pattern = "GET /greet/{name}"

Pattern 是本模块唯一路由(标准库 ServeMux 语法)。导出供测试挂载同一 pattern。

Variables

This section is empty.

Functions

func Module

func Module(log *slog.Logger) appkit.Module

Module 返回 greet 模块。真实域 repo 中这是唯一导出入口(DESIGN §1 铁律 3)。

func NewHandler

func NewHandler(log *slog.Logger, svc greetapi.Service) http.Handler

NewHandler 返回 /greet 处理器,对应真实域 repo 的 internal/http: 只做解码与 DTO 映射,业务错误原样上抛,统一经 httpserver.WriteError 出口映射为 RFC 9457——整条路径只在出口 log 一次。

func NewService

func NewService() greetapi.Service

NewService 返回 greetapi.Service 的本地实现。

Types

This section is empty.

Jump to

Keyboard shortcuts

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