Documentation ¶
Index ¶
Constants ¶
View Source
const (
Version = "1.0.0"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Gin *gin.Engine FS embed.FS DB *db.DB Cache cache.Cache Redis *redis.Redis Logger *logger.Logger Translator ut.Translator Lang *i18n.I18n Services []Service Routes []Route Validations []Validation ShutdownFuncs []func() Version string }
func NewApplication ¶
func NewApplication(fs embed.FS) *Application
NewApplication create a new application
func (*Application) AddService ¶
func (app *Application) AddService(ss ...Service)
AddService add service
func (*Application) AddShutdown ¶
func (app *Application) AddShutdown(fn func())
AddShutdown add shutdown function
func (*Application) AddValidation ¶
func (app *Application) AddValidation(vs ...Validation)
AddValidation add validation
type Service ¶
type Service interface { Boot(*Application) Register(*Application) }
type Validation ¶
type Validation func(*validator.Validate, ut.Translator)
Click to show internal directories.
Click to hide internal directories.