api

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPMux

func NewHTTPMux(logger *zap.Logger) (rest.Mux, error)

NewHTTPMux 创建路由实例

func OnPanicNotify

func OnPanicNotify(logger *zap.Logger) rest.OnPanicNotify

OnPanicNotify 模拟panic通知

func RecordMetrics

func RecordMetrics(method, uri string, success bool, httpCode, businessCode int, costSeconds float64)

RecordMetrics 模拟记录prometheus指标

func SessionHandler

func SessionHandler(ctx rest.Context) (session interface{}, err error)

SessionHandler 模拟验证token session应该是一个struct用来存储userinfo,这里仅使用string模拟一下。

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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