Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Domain string `json:"domain"` Port int `json:"port"` Env string `json:"env"` Pepper string `json:"pepper"` ServMail string `json:"service_email"` ServPass string `json:"service_password"` HMACKey string `json:"hmac_key"` Database PostgresConfig `json:"database"` Redis RedisConfig `json:"redis"` JWT JWTConfig `json:"jwt"` Google SocialProviderConfig `json:"google"` Facebook SocialProviderConfig `json:"facebook"` }
Config parameters
func GetInstance ¶
func GetInstance() *Config
GetInstance Returns config singleton object,
- if not initialized: returns after initialization
func LoadConfig ¶
LoadConfig returns config for the app
*Takes config filename as a argument *If empty string is passed, uses default file
type JWTConfig ¶
type JWTConfig struct { AccessSecret string `json:"access_secret"` RefreshSecret string `json:"refresh_secret"` AccessExp time.Duration `json:"access_exp"` RefreshExp time.Duration `json:"refresh_exp"` }
JWTConfig secrets
type OtacConfig ¶
type OtacConfig struct { EntryPrefix string `json:"otac_prefix"` // Prefix of otac key(prefix+email) in redis Expires int64 `json:"otac_expire"` // Time before expiration }
OtacConfig parameters
type PostgresConfig ¶
type PostgresConfig struct { Host string `json:"host"` Port int `json:"port"` User string `json:"user"` Password string `json:"password"` Name string `json:"name"` }
PostgresConfig parameters
func (*PostgresConfig) DBConnectionInfo ¶
func (c *PostgresConfig) DBConnectionInfo() string
DBConnectionInfo returns database connection info
func (PostgresConfig) Dialect ¶
func (PostgresConfig) Dialect() string
Dialect returns config dialect
type RedisConfig ¶
type RedisConfig struct { Host string `json:"host"` Port int `json:"port"` OTAC OtacConfig `json:"otac"` }
RedisConfig parameters
type SocialProviderConfig ¶
type SocialProviderConfig struct { ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` }
Google oauth config
Click to show internal directories.
Click to hide internal directories.