config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AIConfig

type AIConfig struct {
	OpenAIAPIKey    string
	AnthropicAPIKey string
	DefaultModel    string
	Temperature     float64
	MaxTokens       int
	RequestTimeout  time.Duration
	RetryCount      int
	EmbeddingModel  string
}

AIConfig holds configuration for AI services (LLMs).

type Config

type Config struct {
	Server   ServerConfig
	Database DatabaseConfig
	Redis    RedisConfig
	AI       AIConfig
}

Config holds the entire application configuration.

func Load

func Load() (*Config, error)

Load initializes the configuration from environment variables. It sets reasonable defaults where environment variables are missing.

type DatabaseConfig

type DatabaseConfig struct {
	Host         string
	Port         int
	User         string
	Password     string
	Name         string
	SSLMode      string
	MaxOpenConns int
	MaxIdleConns int
	MaxLifetime  time.Duration
}

DatabaseConfig holds configuration for the PostgreSQL database.

func (*DatabaseConfig) DSN

func (db *DatabaseConfig) DSN() string

DSN returns the PostgreSQL Data Source Name.

type RedisConfig

type RedisConfig struct {
	Address      string
	Password     string
	DB           int
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	PoolSize     int
}

RedisConfig holds configuration for the Redis cache/queue.

type ServerConfig

type ServerConfig struct {
	Port            string
	Host            string
	Environment     string // development, staging, production
	ReadTimeout     time.Duration
	WriteTimeout    time.Duration
	ShutdownTimeout time.Duration
	AllowedOrigins  []string
	Debug           bool
}

ServerConfig holds configuration for the HTTP server.

Jump to

Keyboard shortcuts

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