Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultAge int = 600
View Source
const (
TopicSession string = "session"
)
Variables ¶
This section is empty.
Functions ¶
func DeleteAllSession ¶ added in v1.0.1
func DeleteAllSession()
func DeleteSession ¶
func DeleteSession(token string)
func DeleteSessionByUserId ¶
func DeleteSessionByUserId(userId string)
func GetRequestBody ¶
func SessionMiddle ¶
func SessionMiddle() gin.HandlerFunc
func UpdateSession ¶
func UpdateSession(token string)
Types ¶
type Controller ¶
type Controller interface { Group() *gin.RouterGroup GET(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) POST(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) PUT(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) DELETE(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) PATCH(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) HEAD(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) OPTIONS(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) GETWithSession(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) POSTWithSession(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) PUTWithSession(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) DELETEWithSession(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) PATCHWithSession(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) HEADWithSession(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) OPTIONSWithSession(relativePath string, handler HandlerFunc, middle ...gin.HandlerFunc) }
func New ¶
func New(prefix string) (Controller, error)
type HandlerFunc ¶
type Session ¶
type Session struct { Token string `json:"token"` UserId string `json:"userId"` Username string `json:"username"` Ip string `json:"ip"` Context interface{} `json:"context,omitempty"` // contains filtered or unexported fields }
func CreateSession ¶
func GetSession ¶
Click to show internal directories.
Click to hide internal directories.