22 lines
590 B
Go
22 lines
590 B
Go
package config
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Config struct {
|
|
Server struct {
|
|
Host string `env:"SERVER_HOST" env-default:"localhost"`
|
|
Port string `env:"SERVER_PORT" env-default:"3006"`
|
|
}
|
|
Database struct {
|
|
DSN string `env:"DB_DSN,required"`
|
|
}
|
|
Auth struct {
|
|
AccessTokenSecret string `env:"ACCESS_TOKEN_SECRET,required"`
|
|
RefreshTokenSecret string `env:"REFRESH_TOKEN_SECRET,required"`
|
|
AccessTokenExpiry time.Duration `env:"ACCESS_TOKEN_EXPIRY" env-default:"15m"`
|
|
RefreshTokenExpiry time.Duration `env:"REFRESH_TOKEN_EXPIRY" env-default:"168h"` // 7 дней
|
|
}
|
|
}
|