Documentation
¶
Index ¶
- func Debug(msg string)
- func Debugf(format string, args ...any)
- func Error(msg string)
- func Errorf(format string, args ...any)
- func GetBool(key string, defaultValue bool) (bool, error)
- func GetInt(key string, defaultValue int) (int, error)
- func GetString(key string, defaultValue string) (string, error)
- func Info(msg string)
- func Infof(format string, args ...any)
- func MustGetBool(key string, defaultValue bool) bool
- func MustGetInt(key string, defaultValue int) int
- func MustGetString(key string, defaultValue string) string
- func MustSetConstantsWithPrefix()
- func MustSetConstantsWithoutPrefix()
- func NewDBFromEnv() (*sqlx.DB, error)
- func SetCustomLoggerFromEnv() error
- func Warn(msg string)
- func Warnf(format string, args ...any)
- type Handler
- type Job
- type Option
- func WithApiHandler(subpath string, handlerList ...Handler) Option
- func WithAppMigrations(appMigrationFS embed.FS) Option
- func WithCustomCookieGenerator(cookieGenerator *common.CookieGenerator) Option
- func WithCustomHashingManager(hashingManager *crypto.HashingManager) Option
- func WithCustomIDGenerator(idGenerator func() string) Option
- func WithCustomResponseHandler(responseHandler *common.ResponseHandler) Option
- func WithCustomValidationManager(validationManager *validation.ValidationManager) Option
- func WithDefaultApiHandler(handlerList ...Handler) Option
- func WithDefaultMiddleware() Option
- func WithDefaultScheduler(jobList ...Job) Option
- func WithGostarterMigration() Option
- func WithGracefulShutdownTimeout(timeout time.Duration) Option
- func WithHttpServer() Option
- func WithMiddleware(middlewareList ...middleware.Middleware) Option
- func WithPort(port string) Option
- func WithScheduler(jobList ...Job) Option
- func WithStaticSite(path string, siteFs fs.FS) Option
- type Scheduler
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustGetBool ¶
func MustGetInt ¶
func MustGetString ¶
func MustSetConstantsWithPrefix ¶
func MustSetConstantsWithPrefix()
func MustSetConstantsWithoutPrefix ¶
func MustSetConstantsWithoutPrefix()
func NewDBFromEnv ¶
NewDBFromEnv creates a new database connection based on the environment variables defined in the env package. It returns a pointer to sqlx.DB and an error if any occurs during the connection process.
func SetCustomLoggerFromEnv ¶
func SetCustomLoggerFromEnv() error
SetCustomLoggerFromEnv sets a custom logger based on the log level defined in the environment variables. It uses the slog package to create a new logger with a custom handler that formats log messages with a timestamp, log level, and message. The log level is set based on the value of env.LogLevel.
Types ¶
type Job ¶
func DefaultSchedulerJobFromEnv ¶
func DefaultSchedulerJobFromEnv(schedulerService *cron.SchedulerService) []Job
func SQLiteBackupJob ¶
func SQLiteBackupJob(schedulerService *cron.SchedulerService) Job
func SessionCleanupJob ¶
func SessionCleanupJob(schedulerService *cron.SchedulerService) Job
type Option ¶
func WithApiHandler ¶
func WithAppMigrations ¶
func WithCustomCookieGenerator ¶
func WithCustomCookieGenerator(cookieGenerator *common.CookieGenerator) Option
func WithCustomHashingManager ¶
func WithCustomHashingManager(hashingManager *crypto.HashingManager) Option
func WithCustomIDGenerator ¶
func WithCustomResponseHandler ¶
func WithCustomResponseHandler(responseHandler *common.ResponseHandler) Option
func WithCustomValidationManager ¶
func WithCustomValidationManager(validationManager *validation.ValidationManager) Option
func WithDefaultApiHandler ¶
func WithDefaultMiddleware ¶
func WithDefaultMiddleware() Option
func WithDefaultScheduler ¶
func WithGostarterMigration ¶
func WithGostarterMigration() Option
func WithHttpServer ¶
func WithHttpServer() Option
func WithMiddleware ¶
func WithMiddleware(middlewareList ...middleware.Middleware) Option
func WithScheduler ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewScheduler ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) StartWithGracefulShutdown ¶
func (s *Server) StartWithGracefulShutdown()
Click to show internal directories.
Click to hide internal directories.