ackhttp

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package ackhttp 把确认决定/查询路由挂载到任意 http.ServeMux, 仅依赖标准库与 ack。身份从请求上下文解析:鉴权中间件将用户写入 ctx,网关经 WithUserFunc 取值;未配置动态身份时使用静态 WithUser 值。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(mux *http.ServeMux, g *ack.Gateway, opts ...Option)

Mount 把确认路由挂载到 mux:

POST {p}/confirmation     提交人工决定(同意/拒绝,可选 remember)
GET  {p}/confirmations    查询会话的待确认项

前缀默认 "/ack",可用 WithPrefix 调整。

Types

type Option

type Option func(*options)

Option 配置路由挂载。

func WithPrefix

func WithPrefix(p string) Option

WithPrefix 设置路由前缀(默认 "/ack")。

Jump to

Keyboard shortcuts

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