core

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 25 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 InitDatabaseAPI

func InitDatabaseAPI() error

InitDatabaseAPI initializes the database connection from configuration

func Load

func Load(configPath string) error

Load reads and parses the configuration file

func RunAPI

func RunAPI(handler http.Handler) error

RunAPI starts the HTTP server for the API with graceful shutdown support

func RunLanding

func RunLanding(handler http.Handler) error

RunLanding starts the HTTP server for the landing page with graceful shutdown support

func RunPlatform

func RunPlatform(handler http.Handler) error

RunPlatform starts the HTTP server for the platform with graceful shutdown support

func SetupAPI

func SetupAPI(Static embed.FS) http.Handler

SetupAPI creates and configures the HTTP server for the API

func SetupLanding

func SetupLanding(Static embed.FS) http.Handler

SetupLanding creates and configures the HTTP server for the landing page

func SetupLogging

func SetupLogging() error

SetupLogging configures the logging system based on viper configuration

func SetupPlatform

func SetupPlatform(Static embed.FS) http.Handler

SetupPlatform creates and configures the HTTP server for the platform

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