cedar-session cedar-router 的 session 组件开源项目

我要开发同款
匿名用户2020年03月12日
201阅读

技术信息

开源地址
https://github.com/tungyao/cedar-session
授权协议
GPL

作品详情

cedar-router的一个sessio组件。

2个方法Set(strig,iterface{})Get(strig)iterface{}使用方法

r:=cedar.NewRouter()

x:=cedar_sessio.NewSessio(r)

x继承所有的httpmethod和group ,只是有些小改动,不能直接使用,只能在httpmethod中使用

从之前的 

r.Get("/",fuc(whttp.ResposeWriter,r*http.Request,il)r.Group("/a",fuc(groups*cedar.Groups){}

到现在的

x.Get("/",fuc(whttp.ResposeWriter,r*http.Request,scedar_sessio.Sessio),il)x.Group("/a",fuc(groups*cedar_sessio.TheGroup){}

改了参数,更多 例子 ,现在使用的是系统自带的map,可能以后会换成 spruce ,分布式的kv数据库

例子

r:=cedar.NewRouter()x:=cedar_sessio.NewSessio(r)x.Get("/set",fuc(whttp.ResposeWriter,r*http.Request,scedar_sessio.Sessio){s.Set("hello","world"+r.RemoteAddr)//设置sessios.Get("hello")//获取sessiow.Write([]byte("hellosessio"))},il)

 

功能介绍

cedar-router 的一个 session 组件。 2 个方法 Set(string,interface{}) Get(string) interface{} 使用方法 r:=cedar....

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论