core

package
v0.0.0-...-b26cdc7 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package core provides core application functionality including server setup and configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDatabase

func InitDatabase() error

InitDatabase initializes the database connection from configuration

func Load

func Load(configPath string) error

Load reads and parses the configuration file

func Run

func Run(handler http.Handler) error

Run starts the HTTP server with graceful shutdown support

func Setup

func Setup(Static embed.FS) http.Handler

Setup creates and configures the HTTP server

func SetupLogging

func SetupLogging() error

SetupLogging configures the logging system based on viper configuration

Types

type Database

type Database struct {
	Driver          string `mapstructure:"driver"`
	Host            string `mapstructure:"host"`
	Port            int    `mapstructure:"port"`
	Username        string `mapstructure:"username"`
	Password        string `mapstructure:"password"`
	Database        string `mapstructure:"database"`
	MaxOpenConns    int    `mapstructure:"max_open_conns"`
	MaxIdleConns    int    `mapstructure:"max_idle_conns"`
	ConnMaxLifetime int    `mapstructure:"conn_max_lifetime"`
	// SQLite specific
	DataSource string `mapstructure:"datasource"`
}

Database holds the database configuration

Jump to

Keyboard shortcuts

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