session
parent
b71bacfcfd
commit
2a7ff7a1ba
|
@ -0,0 +1,8 @@
|
|||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="Go" enabled="true" />
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/Gin.iml" filepath="$PROJECT_DIR$/.idea/Gin.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,10 +0,0 @@
|
|||
package main
|
||||
|
||||
//session中间件开发
|
||||
//1.session模块设计
|
||||
//本质上就是k-v。通过key进行增删改查
|
||||
//session可以存储在内存或者redis中
|
||||
|
||||
func main() {
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package session
|
||||
|
||||
//session中间件开发
|
||||
//1.session模块设计
|
||||
//本质上就是k-v。通过key进行增删改查
|
||||
//session可以存储在内存或者redis中
|
||||
|
||||
type Session interface {
|
||||
Set(key string, value interface{}) error
|
||||
Get(key string) (interface{}, error)
|
||||
Del(key string) error
|
||||
Save() error
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package session
|
||||
|
||||
//定义管理者管理所有session
|
||||
|
||||
type SessionMgr interface {
|
||||
// Init 初始化
|
||||
Init(addr string, options ...string) error
|
||||
CreateSession() (session Session, err error)
|
||||
GetSession(sessionId string) (session Session, err error)
|
||||
}
|
Loading…
Reference in New Issue