Documentation
¶
Index ¶
- Constants
- Variables
- func GetConfReader() *viper.Viper
- func LoadApplicationConfigFile(l listener.ConfigListener)
- type App
- func (a *App) Banner(b string) *App
- func (a *App) ExitDelay(time time.Duration) *App
- func (a *App) Interceptor(interceptor ...mvc.MethodInterceptor) *App
- func (a *App) Log(collector logger.AbstractLogger) *App
- func (a *App) ReadConfig(v any) *App
- func (a *App) ReadConfigSub(v any, sub string) *App
- func (a *App) Run()
Constants ¶
View Source
const ( // Dev development environment Dev = "dev" // Test environment Test = "test" // Prod production environment Prod = "prod" )
Variables ¶
View Source
var Conf *config
Conf project basic configuration
Functions ¶
func GetConfReader ¶
GetConfReader Get config reader of the application
func LoadApplicationConfigFile ¶
func LoadApplicationConfigFile(l listener.ConfigListener)
LoadApplicationConfigFile load the application configuration file
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App application instance
func Default ¶
func Default(listeners ...listener.ApplicationListener) *App
Default Create a default application with gin default logger, exception interception, and cross-domain middleware
func New ¶
func New(listeners []listener.ApplicationListener, middlewares ...gin.HandlerFunc) *App
New Create a clean application, you can add some gin middlewares to the engine
func (*App) ExitDelay ¶
ExitDelay Graceful exit time(default 3s), when reached to shut down the server and trigger PostStop().
func (*App) Interceptor ¶ added in v3.0.1
func (a *App) Interceptor(interceptor ...mvc.MethodInterceptor) *App
Interceptor Add a global interceptor
func (*App) Log ¶ added in v3.0.6
func (a *App) Log(collector logger.AbstractLogger) *App
Log Sets the log collector
func (*App) ReadConfig ¶
ReadConfig Read configuration v config struct pointer
func (*App) ReadConfigSub ¶ added in v3.1.0
ReadConfigSub Read configuration v: config struct pointer sub: sub configuration key
Click to show internal directories.
Click to hide internal directories.