Documentation ¶
Index ¶
- func FileLogger() *log.Logger
- func LogFunc(merge int64, f func(ctx *Context))
- func LogFuncTime(merge int64, time string)
- func LogPrint(format string, values ...any)
- type Context
- type DefaultRouter
- func (r *DefaultRouter) Action(cmd, subCmd int64, method func(msg *Context))
- func (r *DefaultRouter) AddProxy(proxy Proxy)
- func (r *DefaultRouter) AddSkipLog(cmd, subCmd int64)
- func (r *DefaultRouter) ExecuteMethod(msg *Context)
- func (r *DefaultRouter) InvokeFunc(ctx *Context)
- func (r *DefaultRouter) SetProxy(proxy Proxy)
- type ErrProxy
- type H
- type M
- type Proxy
- type ProxyFunc
- type Router
- type ServiceError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileLogger ¶ added in v0.0.12
FileLogger 写入文件日志 -> 记录一些可能不重要的日志,例如客户端主动断开的错误。
func LogFuncTime ¶ added in v0.0.11
Types ¶
type Context ¶
type DefaultRouter ¶
type DefaultRouter struct { // 日志开启 DebugLog bool // 跳过某个路由日志 SkipLogMap map[int64]bool // contains filtered or unexported fields }
DefaultRouter 路由功能
func (*DefaultRouter) Action ¶ added in v0.0.39
func (r *DefaultRouter) Action(cmd, subCmd int64, method func(msg *Context))
Action 添加函数
func (*DefaultRouter) AddProxy ¶
func (r *DefaultRouter) AddProxy(proxy Proxy)
AddProxy 添加代理器,最先添加的最最后执行。 异常中间件应该在最后添加机,用于捕获所有异常 ProxyFunc
func (*DefaultRouter) AddSkipLog ¶ added in v0.0.24
func (r *DefaultRouter) AddSkipLog(cmd, subCmd int64)
AddSkipLog 添加排除日志方法
func (*DefaultRouter) ExecuteMethod ¶
func (r *DefaultRouter) ExecuteMethod(msg *Context)
func (*DefaultRouter) InvokeFunc ¶
func (r *DefaultRouter) InvokeFunc(ctx *Context)
InvokeFunc 代理函数执行
func (*DefaultRouter) SetProxy ¶
func (r *DefaultRouter) SetProxy(proxy Proxy)
type ErrProxy ¶ added in v0.0.24
type ErrProxy struct {
ProxyFunc
}
func (*ErrProxy) InvokeFunc ¶ added in v0.0.24
type ProxyFunc ¶
type ProxyFunc struct {
Proxy Proxy
}
ProxyFunc 代理模型
func (*ProxyFunc) InvokeFunc ¶
type Router ¶
type Router interface { // Action 添加路由 Action(cmd, subCmd int64, method func(ctx *Context)) // ExecuteMethod 执行函数 ExecuteMethod(msg *Context) // AddProxy 添加代理 AddProxy(proxy Proxy) }
Router 路由器功能
type ServiceError ¶ added in v0.0.24
func NewServiceError ¶ added in v0.0.24
func NewServiceError(code int, message string) *ServiceError
Click to show internal directories.
Click to hide internal directories.