web

package
v0.32.6 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: AGPL-3.0, AGPL-3.0-only Imports: 44 Imported by: 0

README

req

请求

res

响应

session

session manager

rate

登录限流

middleware

  • middleware/ua 检查请求 User-Agent
  • middleware/origin 检查请求 Origin
  • middleware/recovery panic-recover

handler

路由应该是 internal/web/handler.Handler 的一个方法。

使用 res.NewError(code int, message string) error 或者类似的 res.BadRequest(msg string) 来返回 http 响应。

frontend

前端 Demo https://next.bgm.tv/demo/login

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AddRouters added in v0.30.3

func AddRouters(
	app *echo.Echo,
	c config.AppConfig,
	common common.Common,
	h handler.Handler,
	userHandler user.User,
	personHandler person.Person,
	characterHandler character.Character,
	pmHandler pm.PrivateMessage,
	notificationHandler notification.Notification,
	subjectHandler subject.Subject,
	indexHandler index.Handler,
)

AddRouters add all router and default 404 Handler to app.

func New

func New() *echo.Echo

func NewTestingApp added in v0.30.16

func NewTestingApp() *echo.Echo

NewTestingApp create a base echo App for testing default production echo app handle panic, this doesn't.

func Start added in v0.30.3

func Start(c config.AppConfig, app *echo.Echo) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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