utils

package
v0.0.0-...-55343b0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MigrationFiles embed.FS

Functions

func InitializeDB

func InitializeDB() (*sql.DB, error)

InitializeDB creates the database file and runs migrations if needed.

func ParseCommands

func ParseCommands(input string) []string

Types

type Config

type Config struct {
	Environment string `mapstructure:"ENVIRONMENT"`
	DBSource    string `mapstructure:"DB_SOURCE"`

	// Map of model configurations
	Models map[string]ModelConfig `mapstructure:"AI_MODELS"`
}

func LoadConfig

func LoadConfig(path string) (config Config, err error)

LoadConfig reads configuration from file or environment variables.

type ModelConfig

type ModelConfig struct {
	Name    string `mapstructure:"NAME"`
	BaseURL string `mapstructure:"BASE_URL"`
	APIKey  string `mapstructure:"API_KEY"`
}

Config stores all configuration of the application. The values are read by viper from a config file or environment variable.

Jump to

Keyboard shortcuts

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