Versions in this module Expand all Collapse all v0 v0.0.2 Dec 29, 2023 Changes in this version + func NewInstance[T any]() *T + type AppSentry struct + Params types.AppSentryConfig + func NewSentry(cfg types.AppConfig, lc fx.Lifecycle, logger *AppLogger) (*AppSentry, error) + func (*AppSentry) CaptureException(err error) + func (*AppSentry) CaptureRequest(r *http.Request) + func (*AppSentry) SetExtra(key string, value interface{}) + func (*AppSentry) SetTag(key, value string) + func (*AppSentry) SetUser(id string) + func (sty *AppSentry) ReportEvent(event_id types.UserDefinedEvent, eventMessage string, ...) type LoggerParams + func (lp *LoggerParams) CloseLogFile() + func (lp *LoggerParams) CreateLogWriter(filename string) io.Writer v0.0.1 Dec 28, 2023 Changes in this version + var Module = fx.Module("bootstrap", fx.Provide(NewLogger, NewDB, NewApplication)) + func GetMessage(code int) string + func GlobalErrorMiddleware() gin.HandlerFunc + func LoadConfig[T any](yamlFile string) (*T, error) + func NewHttpServer(app *Application, logger *AppLogger) *http.Server + func SaveConfig[T any](cfg *T, yamlFile string) error + func SetErrorInfo(ei map[int]string) + type AppLogger struct + Params LoggerParams + RawLogger *slog.Logger + func NewLogger(params LoggerParams, lc fx.Lifecycle) *AppLogger + func (logger *AppLogger) Debug(msg string, args ...any) + func (logger *AppLogger) DebugContext(ctx context.Context, msg string, args ...any) + func (logger *AppLogger) Enabled(ctx context.Context, level slog.Level) bool + func (logger *AppLogger) Error(msg string, args ...any) + func (logger *AppLogger) ErrorContext(ctx context.Context, msg string, args ...any) + func (logger *AppLogger) Handler() slog.Handler + func (logger *AppLogger) Info(msg string, args ...any) + func (logger *AppLogger) InfoContext(ctx context.Context, msg string, args ...any) + func (logger *AppLogger) Log(ctx context.Context, level slog.Level, msg string, args ...any) + func (logger *AppLogger) LogAttrs(ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr) + func (logger *AppLogger) Warn(msg string, args ...any) + func (logger *AppLogger) WarnContext(ctx context.Context, msg string, args ...any) + type Application struct + Config *ApplicationConfig + func NewApplication(logger *AppLogger, cfg *ApplicationConfig, lc fx.Lifecycle) *Application + func (app *Application) RunServer(logger *AppLogger) error + type ApplicationConfig struct + ServerAddr string + TrustedProxies string + Verbose bool + type DBParams struct + Database string + Host string + Password string + Port int + Type string + User string + func NewDBParams(dbtype string, dbhost string, dbport int, dbdatabase string, dbuser string, ...) DBParams + func (param DBParams) GetConnectionString() (string, error) + type DBToolKit struct + func NewDB(param DBParams) (*DBToolKit, error) + type LoggerParams struct + Config sloggin.Config + DefaultLevel slog.Level + LogFileName string + type Result struct + Code int + Data interface{} + Message string + func NewQuickResult(code int, data interface{}) Result + func NewResult(code int, message string, data interface{}) Result + func (result Result) Fail(c *gin.Context) + func (result Result) OK(c *gin.Context)