24 lines
		
	
	
		
			407 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			407 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package config
 | 
						|
 | 
						|
import "os"
 | 
						|
 | 
						|
type RedisConfig struct {
 | 
						|
	Host     string
 | 
						|
	Port     string
 | 
						|
	Password string
 | 
						|
	Addr     string
 | 
						|
}
 | 
						|
 | 
						|
func LoadRedisConfig() *RedisConfig {
 | 
						|
	host := os.Getenv("REDIS_HOST")
 | 
						|
	port := os.Getenv("REDIS_PORT")
 | 
						|
	password := os.Getenv("REDIS_PASSWORD")
 | 
						|
	addr := os.Getenv("REDIS_ADDR")
 | 
						|
	return &RedisConfig{
 | 
						|
		Host:     host,
 | 
						|
		Port:     port,
 | 
						|
		Password: password,
 | 
						|
		Addr:     addr,
 | 
						|
	}
 | 
						|
}
 |