user auth register
This commit is contained in:
@@ -29,6 +29,7 @@ type Config struct {
|
||||
Jwt Jwt `mapstructure:"jwt"`
|
||||
Log Log `mapstructure:"log"`
|
||||
S3Config S3Config `mapstructure:"s3"`
|
||||
Fonnte Fonnte `mapstructure:"fonnte"`
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -79,3 +80,15 @@ func (c *Config) Port() string {
|
||||
func (c *Config) LogFormat() string {
|
||||
return c.Log.LogFormat
|
||||
}
|
||||
|
||||
func (c *Config) GetFonnte() *Fonnte {
|
||||
return &c.Fonnte
|
||||
}
|
||||
|
||||
func (c *Config) GetCustomerJWTSecret() string {
|
||||
return c.Jwt.Customer.Token.Secret
|
||||
}
|
||||
|
||||
func (c *Config) GetCustomerJWTExpiresTTL() int {
|
||||
return c.Jwt.Customer.Token.ExpiresTTL
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package config
|
||||
|
||||
type Fonnte struct {
|
||||
ApiUrl string `mapstructure:"api_url"`
|
||||
Token string `mapstructure:"token"`
|
||||
Timeout int `mapstructure:"timeout"`
|
||||
}
|
||||
|
||||
func (f *Fonnte) GetApiUrl() string {
|
||||
return f.ApiUrl
|
||||
}
|
||||
|
||||
func (f *Fonnte) GetToken() string {
|
||||
return f.Token
|
||||
}
|
||||
|
||||
func (f *Fonnte) GetTimeout() int {
|
||||
return f.Timeout
|
||||
}
|
||||
+6
-1
@@ -1,10 +1,15 @@
|
||||
package config
|
||||
|
||||
type Jwt struct {
|
||||
Token Token `mapstructure:"token"`
|
||||
Token Token `mapstructure:"token"`
|
||||
Customer Customer `mapstructure:"customer"`
|
||||
}
|
||||
|
||||
type Token struct {
|
||||
ExpiresTTL int `mapstructure:"expires-ttl"`
|
||||
Secret string `mapstructure:"secret"`
|
||||
}
|
||||
|
||||
type Customer struct {
|
||||
Token Token `mapstructure:"token"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user