config

package
v0.0.0-...-82d1dcb Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APPConfig

type APPConfig struct {
	Port int `mapstructure:"port"`
}

type Config

type Config struct {
	LLM   LLMConfig   `mapstructure:"llm"`
	MySQL MySQLConfig `mapstructure:"mysql"`
	APP   APPConfig   `mapstructure:"app"`
	Redis RedisConfig `mapstructure:"redis"`
	Email SMTPConfig  `mapstructure:"email"`
	JWT   JWTConfig   `mapstructure:"jwt"`
}

func Init

func Init() (*Config, error)

Init 初始化配置

type JWTConfig

type JWTConfig struct {
	SecretKey string        `mapstructure:"secret_key"` // JWT密钥
	Expire    time.Duration `mapstructure:"expire"`     // 过期时间(小时)
}

JWTConfig JWT配置

type LLMConfig

type LLMConfig struct {
	Model   string `mapstructure:"model"`
	APIKey  string `mapstructure:"api_key"`
	BaseURL string `mapstructure:"base_url"`
}

type MySQLConfig

type MySQLConfig struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	Database string `mapstructure:"database"`
}

type RedisConfig

type RedisConfig struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Password string `yaml:"password"`
	DB       int    `yaml:"db"`
}

type SMTPConfig

type SMTPConfig struct {
	Host     string `yaml:"host"`     // SMTP服务器地址
	Port     int    `yaml:"port"`     // SMTP服务器端口
	Username string `yaml:"username"` // SMTP认证用户名
	Password string `yaml:"password"` // SMTP认证密码
	From     string `yaml:"from"`     // 发件人邮箱地址
}

SMTPConfig 定义SMTP服务器配置

Jump to

Keyboard shortcuts

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