Documentation
¶
Index ¶
- type Application
- func (app *Application) AddMiddleware(middleware fiber.Handler)
- func (app *Application) AutoLoadModules() error
- func (app *Application) GetAppConfig() *config.AppConfig
- func (app *Application) GetCacheConfig() *config.CacheConfig
- func (app *Application) GetConfig() *Config
- func (app *Application) GetContainer() *Container
- func (app *Application) GetCronMonitor() *monitoring.CronMonitor
- func (app *Application) GetDatabaseConfig() *config.DatabaseConfig
- func (app *Application) GetMiddlewareStack() *middleware.MiddlewareStack
- func (app *Application) GetModuleManager() *ModuleManager
- func (app *Application) GetQueueMonitor() *monitoring.QueueMonitor
- func (app *Application) GetSwagger() *swagger.SwaggerMiddleware
- func (app *Application) GetSystemMonitor() *monitoring.SystemMonitor
- func (app *Application) GetValidator() *validation.Validator
- func (app *Application) RegisterModule(module Module) error
- func (app *Application) RegisterRoute(method, path string, decorators ...swagger.RouteDecorator)
- func (app *Application) SetMiddlewareStack(stack *middleware.MiddlewareStack)
- func (app *Application) Start() error
- func (app *Application) UseMiddleware(middleware fiber.Handler)
- type Config
- type Container
- func (c *Container) AutoWire(target interface{}) error
- func (c *Container) Bind(name string, service interface{})
- func (c *Container) Clear()
- func (c *Container) Has(name string) bool
- func (c *Container) MustResolve(name string) interface{}
- func (c *Container) Resolve(name string) (interface{}, error)
- func (c *Container) Singleton(name string, factory func() interface{})
- type Module
- type ModuleManager
- type ModuleRegistry
- type PlaceholderModule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
Application represents the main Mithril application
func (*Application) AddMiddleware ¶
func (app *Application) AddMiddleware(middleware fiber.Handler)
AddMiddleware adds a middleware to the stack
func (*Application) AutoLoadModules ¶
func (app *Application) AutoLoadModules() error
AutoLoadModules automatically loads modules from the app/modules directory
func (*Application) GetAppConfig ¶
func (app *Application) GetAppConfig() *config.AppConfig
GetAppConfig returns the application configuration
func (*Application) GetCacheConfig ¶
func (app *Application) GetCacheConfig() *config.CacheConfig
GetCacheConfig returns the cache configuration
func (*Application) GetConfig ¶
func (app *Application) GetConfig() *Config
GetConfig returns the application configuration
func (*Application) GetContainer ¶
func (app *Application) GetContainer() *Container
GetContainer returns the dependency injection container
func (*Application) GetCronMonitor ¶
func (app *Application) GetCronMonitor() *monitoring.CronMonitor
GetCronMonitor returns the cron monitor
func (*Application) GetDatabaseConfig ¶
func (app *Application) GetDatabaseConfig() *config.DatabaseConfig
GetDatabaseConfig returns the database configuration
func (*Application) GetMiddlewareStack ¶
func (app *Application) GetMiddlewareStack() *middleware.MiddlewareStack
GetMiddlewareStack returns the middleware stack
func (*Application) GetModuleManager ¶
func (app *Application) GetModuleManager() *ModuleManager
GetModuleManager returns the module manager
func (*Application) GetQueueMonitor ¶
func (app *Application) GetQueueMonitor() *monitoring.QueueMonitor
GetQueueMonitor returns the queue monitor
func (*Application) GetSwagger ¶
func (app *Application) GetSwagger() *swagger.SwaggerMiddleware
GetSwagger returns the Swagger middleware
func (*Application) GetSystemMonitor ¶
func (app *Application) GetSystemMonitor() *monitoring.SystemMonitor
GetSystemMonitor returns the system monitor
func (*Application) GetValidator ¶
func (app *Application) GetValidator() *validation.Validator
GetValidator returns the validation instance
func (*Application) RegisterModule ¶
func (app *Application) RegisterModule(module Module) error
RegisterModule registers a module
func (*Application) RegisterRoute ¶
func (app *Application) RegisterRoute(method, path string, decorators ...swagger.RouteDecorator)
RegisterRoute registers a route with Swagger documentation
func (*Application) SetMiddlewareStack ¶
func (app *Application) SetMiddlewareStack(stack *middleware.MiddlewareStack)
SetMiddlewareStack sets a custom middleware stack
func (*Application) Start ¶
func (app *Application) Start() error
Start starts the application server
func (*Application) UseMiddleware ¶
func (app *Application) UseMiddleware(middleware fiber.Handler)
UseMiddleware applies a middleware to the app
type Config ¶
type Config struct {
Name string
Version string
Environment string
Debug bool
Port string
Host string
}
Config holds the application configuration
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container is a simple dependency injection container
func (*Container) AutoWire ¶
AutoWire attempts to automatically wire dependencies based on struct tags
func (*Container) MustResolve ¶
MustResolve retrieves a service from the container and panics if not found
type Module ¶
type Module interface {
RegisterRoutes()
GetName() string
}
Module represents a Mithril module
type ModuleManager ¶
type ModuleManager struct {
// contains filtered or unexported fields
}
ModuleManager manages all registered modules
func NewModuleManager ¶
func NewModuleManager(app *Application) *ModuleManager
NewModuleManager creates a new module manager
func (*ModuleManager) AutoLoadModules ¶
func (mm *ModuleManager) AutoLoadModules() error
AutoLoadModules automatically loads modules from the app/modules directory
func (*ModuleManager) GetModule ¶
func (mm *ModuleManager) GetModule(name string) (Module, bool)
GetModule returns a registered module by name
func (*ModuleManager) ListModules ¶
func (mm *ModuleManager) ListModules() map[string]Module
ListModules returns all registered modules
func (*ModuleManager) RegisterModule ¶
func (mm *ModuleManager) RegisterModule(module Module) error
RegisterModule registers a module
type ModuleRegistry ¶
type ModuleRegistry struct {
// contains filtered or unexported fields
}
ModuleRegistry provides a simple way to register modules
func NewModuleRegistry ¶
func NewModuleRegistry(manager *ModuleManager) *ModuleRegistry
NewModuleRegistry creates a new module registry
func (*ModuleRegistry) Register ¶
func (mr *ModuleRegistry) Register(module Module) error
Register registers a module
func (*ModuleRegistry) RegisterAll ¶
func (mr *ModuleRegistry) RegisterAll(modules ...Module) error
RegisterAll registers multiple modules
type PlaceholderModule ¶
type PlaceholderModule struct {
// contains filtered or unexported fields
}
PlaceholderModule is a placeholder for dynamically loaded modules
func (*PlaceholderModule) GetName ¶
func (pm *PlaceholderModule) GetName() string
GetName returns the module name
func (*PlaceholderModule) RegisterRoutes ¶
func (pm *PlaceholderModule) RegisterRoutes()
RegisterRoutes registers routes for the placeholder module