Documentation ¶
Index ¶
- func DefaultGRPC() application.Application
- func DefaultHTTP() application.Application
- func EnableHealthCheckURL(path ...string)
- func New() application.Application
- func RegisterController(controllerName string, instance interface{}, ...)
- func RegisterInstance(instance interface{}, tags ...string)
- func SetConfigPath(path string)
- func SetHealthCheckDefaultHandler(handler func(app application.Application) func(c *gin.Context))
- func SetIsLogSelfCheck(isLog bool)
- type Application
- func (app *Application) Conf() conf.Conf
- func (app *Application) ContextPool() *application.ContextPool
- func (app *Application) ControllerPool() *application.ControllerPool
- func (app *Application) DB() *gorm.DB
- func (app *Application) GetGRPCServer() *grpc.Server
- func (app *Application) InitGRPC()
- func (app *Application) InitHTTP()
- func (app *Application) InitRouter()
- func (app *Application) InitTrinity()
- func (app *Application) InstallDB(f func() *gorm.DB)
- func (app *Application) InstancePool() *application.InstancePool
- func (app *Application) IsLogSelfCheck() bool
- func (app *Application) Logger() *golog.Logger
- func (app *Application) RegRuntimeKey(runtime ...truntime.RuntimeKey) application.Application
- func (app *Application) Router() *gin.Engine
- func (app *Application) RuntimeKeys() []truntime.RuntimeKey
- func (app *Application) ServeGRPC()
- func (app *Application) ServeHTTP()
- func (app *Application) UseInterceptor(interceptor ...grpc.UnaryServerInterceptor) application.Application
- func (app *Application) UseMiddleware(middleware ...gin.HandlerFunc) application.Application
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableHealthCheckURL ¶ added in v0.0.19
func EnableHealthCheckURL(path ...string)
EnableHealthCheckURL set config path
func RegisterController ¶ added in v0.0.25
func RegisterController(controllerName string, instance interface{}, requestMaps ...*application.RequestMap)
RegisterController bind service
func RegisterInstance ¶ added in v0.0.25
func RegisterInstance(instance interface{}, tags ...string)
RegisterInstance bind instance
func SetHealthCheckDefaultHandler ¶ added in v0.0.19
func SetHealthCheckDefaultHandler(handler func(app application.Application) func(c *gin.Context))
SetHealthCheckDefaultHandler set default health check handler
func SetIsLogSelfCheck ¶ added in v0.0.22
func SetIsLogSelfCheck(isLog bool)
SetIsLogSelfCheck set is log self check by default , it is true
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application core of trinity
func (*Application) ContextPool ¶
func (app *Application) ContextPool() *application.ContextPool
ContextPool get contextpoo;
func (*Application) ControllerPool ¶
func (app *Application) ControllerPool() *application.ControllerPool
ControllerPool get all service pool
func (*Application) GetGRPCServer ¶
func (app *Application) GetGRPCServer() *grpc.Server
GetGRPCServer get grpc server instance
func (*Application) InitRouter ¶
func (app *Application) InitRouter()
InitRouter init router use gin framework by default
func (*Application) InstallDB ¶
func (app *Application) InstallDB(f func() *gorm.DB)
InstallDB install db
func (*Application) InstancePool ¶ added in v0.0.25
func (app *Application) InstancePool() *application.InstancePool
InstancePool get all service pool
func (*Application) IsLogSelfCheck ¶ added in v0.0.22
func (app *Application) IsLogSelfCheck() bool
IsLogSelfCheck if log self check
func (*Application) RegRuntimeKey ¶
func (app *Application) RegRuntimeKey(runtime ...truntime.RuntimeKey) application.Application
RegRuntimeKey register runtime key the runtime key should be lower case , because when the metadata transfer , it will all transform to lower case
func (*Application) RuntimeKeys ¶
func (app *Application) RuntimeKeys() []truntime.RuntimeKey
RuntimeKeys get runtime keys
func (*Application) UseInterceptor ¶
func (app *Application) UseInterceptor(interceptor ...grpc.UnaryServerInterceptor) application.Application
UseInterceptor application use interceptor, only impact on http server
func (*Application) UseMiddleware ¶
func (app *Application) UseMiddleware(middleware ...gin.HandlerFunc) application.Application
UseMiddleware application use middleware , only impact on http server