main
Your Name 2024-09-19 00:09:12 +08:00
parent b71bacfcfd
commit 2a7ff7a1ba
7 changed files with 54 additions and 10 deletions

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

9
.idea/Gin.iml Normal file
View File

@ -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>

8
.idea/modules.xml Normal file
View File

@ -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>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,10 +0,0 @@
package main
//session中间件开发
//1.session模块设计
//本质上就是k-v。通过key进行增删改查
//session可以存储在内存或者redis中
func main() {
}

13
session/session.go Normal file
View File

@ -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
}

10
session/session_mgr.go Normal file
View File

@ -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)
}