config

package
v0.0.0-...-7c08808 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key, fallback string) string

func MigrateDB

func MigrateDB(viper *viper.Viper, logger *logrus.Logger)

func NewDatabase

func NewDatabase(viper *viper.Viper, log *logrus.Logger) *gorm.DB

func NewErrorHandler

func NewErrorHandler() fiber.ErrorHandler

func NewFiber

func NewFiber(viper *viper.Viper) *fiber.App

func NewLogger

func NewLogger(viper *viper.Viper) *logrus.Logger

func NewValidator

func NewValidator(viper *viper.Viper) *validator.Validate

func NewViper

func NewViper() *viper.Viper

Types

type RouteConfig

type RouteConfig struct {
	App               *fiber.App
	Config            *viper.Viper
	Log               *logrus.Logger
	UserController    *controller.UserController
	ArticleController *controller.ArticleController
	TagController     *controller.TagController
	CommentController *controller.CommentController
	AuthMiddleware    fiber.Handler
}

func NewRouteConfig

func NewRouteConfig(app *fiber.App, config *viper.Viper, log *logrus.Logger, userController *controller.UserController, articleController *controller.ArticleController, tagController *controller.TagController, commentController *controller.CommentController, authMiddleware fiber.Handler) *RouteConfig

func (*RouteConfig) SetupRoutes

func (c *RouteConfig) SetupRoutes()

func (*RouteConfig) StartServer

func (c *RouteConfig) StartServer()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL