Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildGinHandler ¶
func BuildGinHandler(fn func(ctx *gin.Context) (interface{}, error)) gin.HandlerFunc
BuildGinHandler 统一构造 gin 的路由函数
func SafeAsyncFunc ¶
func SafeAsyncFunc(fn func()) func()
Types ¶
type IoC ¶
type IoC struct {
// contains filtered or unexported fields
}
func (*IoC) InvokeE ¶
func (c *IoC) InvokeE(fn interface{}, opts ...dig.InvokeOption) error
InvokeE 用于运行时获取容器实例 需要处理返回的错误
func (*IoC) MustInvoke ¶
func (c *IoC) MustInvoke(fn interface{}, opts ...dig.InvokeOption)
MustInvoke 用于启动时获取容器实例 错误将会停止进程直接 panic
func (*IoC) MustProvide ¶
func (c *IoC) MustProvide(constructor interface{}, opts ...dig.ProvideOption)
MustProvide 用于启动时注册容器实例 错误将会停止进程直接 panic
Click to show internal directories.
Click to hide internal directories.