mApp

package
v0.0.0-...-099e974 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APP_NAME = "MoliCTF"
	APP_DESC = "A simple and easy-to-use CTF training platform."
	APP_COPY = template.HTML("© Copyright <a id=\"githubLink\" href=\"https://github.com/8ea7b571/MoliCTF\"> MoliCTF </a> yvling 2024")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JwtUser

type JwtUser struct {
	ID uint `json:"id"`

	Name   string `json:"name"`
	Gender uint   `json:"gender"`
	Phone  string `json:"phone"`
	Email  string `json:"email"`
	Avatar string `json:"avatar"`

	Username string `json:"username"`
	Active   bool   `json:"active"`

	jwt.RegisteredClaims
}

type MApp

type MApp struct {
	Host string
	Port uint
	// contains filtered or unexported fields
}

func NewMApp

func NewMApp() *MApp

func (*MApp) GenerateJwt

func (mapp *MApp) GenerateJwt(user *JwtUser) (string, error)

func (*MApp) PageIndex

func (mapp *MApp) PageIndex(ctx *gin.Context)

PageIndex Index page

func (*MApp) PageLogin

func (mapp *MApp) PageLogin(ctx *gin.Context)

PageLogin Login page

func (*MApp) PageRegister

func (mapp *MApp) PageRegister(ctx *gin.Context)

func (*MApp) PageTeams

func (mapp *MApp) PageTeams(ctx *gin.Context)

PageTeams Teams page

func (*MApp) PageUsers

func (mapp *MApp) PageUsers(ctx *gin.Context)

PageUsers Users page

func (*MApp) ParseJwt

func (mapp *MApp) ParseJwt(tokenStr string) (*JwtUser, error)

func (*MApp) Run

func (mapp *MApp) Run() error

func (*MApp) UserLogin

func (mapp *MApp) UserLogin(ctx *gin.Context)

func (*MApp) UserLogout

func (mapp *MApp) UserLogout(ctx *gin.Context)

func (*MApp) UserRegister

func (mapp *MApp) UserRegister(ctx *gin.Context)

Jump to

Keyboard shortcuts

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