cedar-sessioncedar-router 的 session 组件
cedar-router 的一个 session 组件。
2 个方法
- Set(string,interface{})
- Get(string) interface{}
使用方法
r:=cedar.NewRouter()
x := cedar_session.NewSession(r)
x 继承所有的 http method 和 group ,只是有些小改动 ,不能直接使用 ,只能在 http method 中使用
从之前的
r.Get("/",func(w http.ResponseWriter, r *http.Request,nil)
r.Group("/a", func(groups *cedar.Groups) {}
到现在的
x.Get("/", func(w http.ResponseWriter, r *http.Request, s cedar_session.Session), nil)
x.Group("/a", func(groups *cedar_session.TheGroup) {}
改了参数 ,更多 例子 ,现在使用的是系统自带的map ,可能以后会换成 spruce ,分布式的kv数据库
例子
r := cedar.NewRouter()
x := cedar_session.NewSession(r)
x.Get("/set", func(w http.ResponseWriter, r *http.Request, s cedar_session.Session) {
s.Set("hello", "world"+r.RemoteAddr) // 设置session
s.Get("hello") // 获取session
w.Write([]byte("hello session"))
}, nil)
评论
Uncode-Session集群session共享组件
Uncode-Session非常小巧的集群session公享组件,代码千行以内,避免使用应用容器插件
Uncode-Session集群session共享组件
0
Uncode-Session集群session共享组件
Uncode-Session非常小巧的集群session公享组件,代码千行以内,避免使用应用容器插件的多种烦恼。功能概述非常小巧的集群session共享组件,类似于spring-session。总代码
Uncode-Session集群session共享组件
0
ng-paginationangular.js 的页码组件
ng-pagination是angular.js的页码组件,基于directive实现,样式使用的bootstrap。直接在html代码中加入以下代码即可调用:<page-pagination
ng-paginationangular.js 的页码组件
0
wxPostgresPostgresSQL的UI组件
wxPostgres集成了一些用户的UI组件用来显示来自PostgreSQL数据库的信息,相当于实现了wxWidgets和PostgresSQL之间互操作的UI框架,简化数据库应用的开发。
wxPostgresPostgresSQL的UI组件
0
TacosTapestry 的 Ajax 组件
Tacos类包项目为TapestryWeb框架提供一些高性能的组件,同时也为在页面或自己组件中使用的ajax框架(它当前支持的框架主要是dojo但也支持Prototype,script.aculo.u
TacosTapestry 的 Ajax 组件
0
bootstrap3-dialogbootstrap3 的 modal 组件
用javascript重新包装了 bootstrap3的modal组件,使用更方便更友好! 示例: BootstrapDialog.alert('I want banana!'); 选项多接口多,很实
bootstrap3-dialogbootstrap3 的 modal 组件
0
redis-search4jredis的搜索组件
redis-search4j是一款基于redis的搜索组件特点1.基于redis,性能高效2.实时更新索引3.支持Suggest前缀、拼音查找(AutoComplete功能)4.支持单个或多个分词搜索
redis-search4jredis的搜索组件
0