Add Wildberries product fetching and rate limiting functionality
This commit is contained in:
		
							
								
								
									
										23
									
								
								internal/config/database.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								internal/config/database.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
package config
 | 
			
		||||
 | 
			
		||||
import "os"
 | 
			
		||||
 | 
			
		||||
type DatabaseConfig struct {
 | 
			
		||||
	Host     string
 | 
			
		||||
	Port     string
 | 
			
		||||
	Login    string
 | 
			
		||||
	Password string
 | 
			
		||||
	Database string
 | 
			
		||||
	URL      string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func LoadDatabaseConfig() *DatabaseConfig {
 | 
			
		||||
	return &DatabaseConfig{
 | 
			
		||||
		Host:     os.Getenv("POSTGRES_HOST"),
 | 
			
		||||
		Port:     os.Getenv("POSTGRES_PORT"),
 | 
			
		||||
		Login:    os.Getenv("POSTGRES_LOGIN"),
 | 
			
		||||
		Password: os.Getenv("POSTGRES_PASSWORD"),
 | 
			
		||||
		Database: os.Getenv("POSTGRES_DATABASE"),
 | 
			
		||||
		URL:      os.Getenv("POSTGRES_URL"),
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user