Help us shape the future of Go! Take the 2026 Go Developer Survey

baseurl

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package baseurl 公开链接 base 解析(请求级公开地址推断的单源)。

语义(2026-10-10 自 app/share 域下沉,此前 presign/gen·handler/chunk·share 四处消费 share.ResolveBase 构成 app 跨域边与适配层对域词汇依赖): 显式配置 > 请求来源(bootstrap 中间件注入 ctx)> 空串。 禁止回退 server.host——那是监听地址(0.0.0.0),拼进分享链接对外不可达 (2026-10-07 iStoreOS 真机事故:分享成功弹窗给出 http://0.0.0.0:12345/#/s/x)。 双缺省时退相对路径(/share/CODE),浏览器侧可由 location.origin 补全。

Index

Constants

View Source
const PublicBaseCtxKey = "pb.public_base"

PublicBaseCtxKey hertz ctx 中请求级公开 base 的键。bootstrap 在 server.base_url 未配置时挂中间件,把每条请求的来源(scheme://host)写入 ctx(hertz RequestContext.Value 读取 Set 的 kv)。

Variables

This section is empty.

Functions

func Resolve

func Resolve(ctx context.Context, configured string) string

Resolve 公开链接 base 解析:显式配置 > 请求来源(中间件注入)> 空串。

Types

This section is empty.

Jump to

Keyboard shortcuts

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