application

package
v3.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeLogger added in v3.3.0

func ChangeLogger(logger logger.Logger)

ChangeLogger changing the logger instance used by the application.

func GetConfReader

func GetConfReader() *viper.Viper

GetConfReader returns the configuration reader of the application.

func GetConfig added in v3.3.0

func GetConfig() *config.Config

GetConfig returns the basic configuration of the application.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App represents the main application structure.

func Default

func Default(listeners ...listener.ApplicationListener) *App

Default creates a default application with built-in middleware and listeners.

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) Banner

func (a *App) Banner(b string) *App

Banner sets a custom startup banner.

func (*App) Interceptor added in v3.0.1

func (a *App) Interceptor(interceptor ...mvc.MethodInterceptor) *App

Interceptor Adds a global interceptor

func (*App) ReadConfig

func (a *App) ReadConfig(v any) *App

ReadConfig loads the configuration into the provided structure.

func (*App) ReadConfigSub added in v3.1.0

func (a *App) ReadConfigSub(v any, sub string) *App

ReadConfigSub loads the sub-configuration into the provided structure.

func (*App) Run

func (a *App) Run()

Run starts the application server.

func (*App) ShutdownWaitDelay added in v3.3.7

func (a *App) ShutdownWaitDelay(duration time.Duration) *App

ShutdownWaitDelay sets the delay after the server has shut down (default is 0 seconds). This delay allows time for any post-shutdown tasks (such as cleanup, logging, etc.) to complete before the process exits.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳