session

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRouter

func RegisterRouter(g *gin.RouterGroup)

Types

type Handler

type Handler struct {
}

func (*Handler) Create

func (*Handler) Create() gin.HandlerFunc

func (*Handler) Destroy

func (*Handler) Destroy() gin.HandlerFunc

func (*Handler) List

func (*Handler) List() gin.HandlerFunc

func (*Handler) ViewCurrent

func (*Handler) ViewCurrent() gin.HandlerFunc

type RSession

type RSession struct {
	SessionID string    `json:"session_id"`
	UserID    uint      `json:"user_id"`
	Username  string    `json:"username"`
	IsAdmin   bool      `json:"is_admin,omitempty"`
	ExpireAt  time.Time `json:"expire_at"`
}

func BindList

func BindList(sessions []cpt.Session) []*RSession

func BindSession

func BindSession(session *cpt.Session) *RSession

type ReqCreate

type ReqCreate struct {
	Username string `json:"username" validate:"max=20,min=1,keyword" binding:"max=20,min=1,keyword"`
	Password string `json:"password" validate:"max=50,min=6" binding:"max=50,min=6"`
}

type RespCreate

type RespCreate struct {
	Response
	Session *RSession `json:"session,omitempty"`
}

type RespList

type RespList struct {
	Response
	Sessions []*RSession `json:"sessions"`
}

type RespViewCurrent

type RespViewCurrent struct {
	Response
	Session *RSession `json:"session,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL