web

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 19 Imported by: 0

README

AnimeGo WEB Api接口文档

默认开启Swagger:http://localhost:7991/swagger/index.html
Swagger文档:swagger.json

鉴权

HTPP请求Header中,Access-Key为SHA256后的access_key

Swagger验证方式

通过 /sha256接口,传入配置文件中设置的 access_key,返回加密后的access_key

响应代码

code值所代码含义

200 成功
300 失败
403 鉴权失败
500 服务端未知错误

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cors

func Cors() gin.HandlerFunc

Cors 跨域中间件

func GinLogger

func GinLogger(logger *zap.SugaredLogger) gin.HandlerFunc

GinLogger 接收gin框架默认的日志

func GinRecovery

func GinRecovery(logger *zap.SugaredLogger, stack bool, response func(*gin.Context, any)) gin.HandlerFunc

GinRecovery recover掉项目可能出现的panic

func Init

func Init(opt *InitOptions)

func InitSwagger added in v0.4.3

func InitSwagger(r *gin.Engine)

func KeyAuth

func KeyAuth() gin.HandlerFunc

KeyAuth 鉴权

func Run

func Run(ctx context.Context)

Types

type InitOptions

type InitOptions struct {
	Debug bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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