config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDB

func ConnectDB(dbConf DBConfig) *bun.DB

func ConnectRedis

func ConnectRedis(addr string) *redis.Client

Types

type AWSConfig

type AWSConfig struct {
	Region string `yaml:"region"`
	Bucket string `yaml:"bucket"`
}

type Config

type Config struct {
	Server       ServerConfig `yaml:"server"`
	Database     DBConfig     `yaml:"database"`
	SMTP         SMTPConfig   `yaml:"smtp"`
	AWS          AWSConfig    `yaml:"aws"`
	Redis        string       `yaml:"redis"`
	JWTSecretKey string       `yaml:"jwt_secret_key"`
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

type DBConfig

type DBConfig struct {
	URL          string `yaml:"url"`
	MaxOpenConns int    `yaml:"max_open_conns"`
	MaxIdleConns int    `yaml:"max_idle_conns"`
}

type SMTPConfig

type SMTPConfig struct {
	Host string `yaml:"host"`
	Port string `yaml:"port"`
	From string `yaml:"from"`
}

type ServerConfig

type ServerConfig struct {
	Port    string `yaml:"port"`
	Env     string `yaml:"env"`
	Version string `yaml:"version"`
}

Jump to

Keyboard shortcuts

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