1 Star 0 Fork 0

pku-min-java/min-browser-http

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
contextKey.go 1021 Bytes
一键复制 编辑 原始数据 按行查看 历史
ghy 提交于 2021-06-15 14:33 +08:00 . add: 添加注释again
/*
* @Author: hongyu guo
* @Description:
* @Version: 1.0.0
* @Date: 11:34 2021/06/15
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
*/
package minhttp
// contextKey is a value for use with context.WithValue. It's used as
// a pointer so it fits in an interface{} without allocation.
type contextKey struct {
name string
}
func (k *contextKey) String() string { return "min-http context value " + k.name }
var (
// ServerContextKey is a context key. It can be used in HTTP
// handlers with Context.Value to access the server that
// started the handler. The associated value will be of
// type *Server.
ServerContextKey = &contextKey{"min-http-server"}
// LocalAddrContextKey is a context key. It can be used in
// HTTP handlers with Context.Value to access the local
// address the connection arrived on.
// The associated value will be of type net.Addr.
LocalAddrContextKey = &contextKey{"local-addr"}
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pku-min-java/min-browser-http.git
git@gitee.com:pku-min-java/min-browser-http.git
pku-min-java
min-browser-http
min-browser-http
master

搜索帮助