Documentation
¶
Index ¶
- func BindContainer(container interface{}, tags ...string)
- func BindController(controllerName string, container interface{}, ...)
- func DefaultGRPC() application.Application
- func DefaultHTTP() application.Application
- func EnableHealthCheckURL(path ...string)
- func GetDefaultHeaderPrefix() string
- func New() application.Application
- func SetConfigPath(path string)
- func SetDefaultHeaderPrefix(newPrefix 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) ContainerPool() *application.ContainerPool
- 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) 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 BindContainer ¶
func BindContainer(container interface{}, tags ...string)
BindContainer bind container
func BindController ¶
func BindController(controllerName string, container interface{}, requestMaps ...*application.RequestMap)
BindController bind service
func EnableHealthCheckURL ¶ added in v0.0.19
func EnableHealthCheckURL(path ...string)
EnableHealthCheckURL set config path
func GetDefaultHeaderPrefix ¶
func GetDefaultHeaderPrefix() string
GetDefaultHeaderPrefix set default header prefix
func SetDefaultHeaderPrefix ¶
func SetDefaultHeaderPrefix(newPrefix string)
SetDefaultHeaderPrefix set default header prefix
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 bydefault , it is true
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application core of trinity
func (*Application) ContainerPool ¶
func (app *Application) ContainerPool() *application.ContainerPool
ContainerPool get all serviice pool
func (*Application) ContextPool ¶
func (app *Application) ContextPool() *application.ContextPool
ContextPool get contextpoo;
func (*Application) ControllerPool ¶
func (app *Application) ControllerPool() *application.ControllerPool
ControllerPool get all serviice 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) 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