user auth register

This commit is contained in:
Aditya Siregar
2025-09-18 01:32:01 +07:00
parent c68b536480
commit 65f61b65cf
24 changed files with 2065 additions and 14 deletions
+13
View File
@@ -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
}
+19
View File
@@ -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
View File
@@ -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"`
}