webserver

package
v8.0.0-...-0f2c8d7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const ConstCookieName = "toughradius_cookie"
View Source
const UserSession = "toughradius_user_session"
View Source
const UserSessionLevel = "toughradius_user_session_level"
View Source
const UserSessionName = "toughradius_user_session_name"

Variables

View Source
var (
	SessionSkipPrefix = []string{
		"/ready",
		"/realip",
		"/api",
		"/login",
		"/admin/login",
		"/static",
	}
	JwtSkipPrefix = []string{
		"/ready",
		"/realip",
		"/login",
		"/admin/login",
		"/static",
	}
)

Functions

func ApiANY

func ApiANY(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) []*echo.Route

func ApiDELETE

func ApiDELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func ApiGET

func ApiGET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func ApiPOST

func ApiPOST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func DELETE

func DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func ExportCsv

func ExportCsv(c echo.Context, v interface{}, name string) error

func ExportData

func ExportData(c echo.Context, data []map[string]interface{}, sheet string) error

func ExportJson

func ExportJson(c echo.Context, v interface{}, name string) error

func GET

func GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func GetCurrUser

func GetCurrUser(c echo.Context) *models.SysOpr

func GetCurrUserlevel

func GetCurrUserlevel(c echo.Context) string

func ImportData

func ImportData(c echo.Context, sheet string) ([]map[string]interface{}, error)

ImportData Import the file contents

func Init

func Init()

func Listen

func Listen() error

func POST

func POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func PUT

func PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route

func PubOpLog

func PubOpLog(c echo.Context, message string)

func ServerRecover

func ServerRecover(debug bool) echo.MiddlewareFunc

ServerRecover Web 服务恢复处理中间件

Types

type AdminServer

type AdminServer struct {
	// contains filtered or unexported fields
}

func NewAdminServer

func NewAdminServer() *AdminServer

NewAdminServer 创建管理系统服务器

func (*AdminServer) ParseJwtToken

func (s *AdminServer) ParseJwtToken(tokenstr string) (jwt.MapClaims, error)

ParseJwtToken 解析 Jwt Token

func (*AdminServer) Start

func (s *AdminServer) Start() error

Start Admin Server

func (*AdminServer) WrapJwtHandler

func (s *AdminServer) WrapJwtHandler(h http.Handler) echo.HandlerFunc

Jump to

Keyboard shortcuts

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