config

package
v0.0.0-...-72fb90f Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	SigningKey string        `mapstructure:"signing_key"`
	SecretKey  string        `mapstructure:"secret_key"`
	AccessTTL  time.Duration `mapstructure:"access_ttl"`
	RefreshTTL time.Duration `mapstructure:"refresh_ttl"`
}

type Config

type Config struct {
	Auth   AuthConfig   `mapstructure:"jwt"`
	DB     DbConfig     `mapstructure:"database"`
	Server ServerConfig `mapstructure:"server"`
	Redis  RedisConfig  `mapstructure:"redis"`
	Log    Log          `mapstructure:"log"`
}

func LoadConfig

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

type DbConfig

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

type Log

type Log struct {
	Mode       string   `mapstructure:"mode"`
	Encoding   string   `mapstructure:"encoding"`
	OutputPath []string `mapstructure:"output_path"`
}

type RedisConfig

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

type ServerConfig

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

Jump to

Keyboard shortcuts

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