config

package
v0.0.0-...-6643502 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(filename string, fileType string) (*viper.Viper, error)

Types

type APIConfig

type APIConfig struct {
	BaseUrl string
	Token   string
}

type Config

type Config struct {
	Server   ServerConfig
	Postgres PostgresConfig
	Password PasswordConfig
	Logger   LoggerConfig
	JWT      JWTConfig
	API      APIConfig
}

func GetConfig

func GetConfig() *Config

func ParseConfig

func ParseConfig(v *viper.Viper) (*Config, error)

type JWTConfig

type JWTConfig struct {
	AccessTokenExpireDuration  time.Duration
	RefreshTokenExpireDuration time.Duration
	Secret                     string
	RefreshSecret              string
}

type LoggerConfig

type LoggerConfig struct {
	FilePath string
	Encoding string
	Level    string
	Logger   string
}

type PasswordConfig

type PasswordConfig struct {
	IncludeChars     bool
	IncludeDigits    bool
	MinLength        int
	MaxLength        int
	IncludeUppercase bool
	IncludeLowercase bool
}

type PostgresConfig

type PostgresConfig struct {
	Host            string
	Port            string
	User            string
	Password        string
	DbName          string
	SSLMode         string
	MaxIdleConns    int
	MaxOpenConns    int
	ConnMaxLifetime time.Duration
}

type ServerConfig

type ServerConfig struct {
	InternalPort string
	ExternalPort string
	RunMode      string
}

Jump to

Keyboard shortcuts

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