Changed the conf object to the conf package for better accessibility
This commit is contained in:
		
							
								
								
									
										19
									
								
								conf/conf.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								conf/conf.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
package conf
 | 
			
		||||
 | 
			
		||||
import "sync"
 | 
			
		||||
 | 
			
		||||
type Config struct {
 | 
			
		||||
	MongoURL string
 | 
			
		||||
	DCNAME string
 | 
			
		||||
	DBPOINT string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var instance *Config
 | 
			
		||||
var once sync.Once
 | 
			
		||||
 | 
			
		||||
func GetConfig() *Config {
 | 
			
		||||
	once.Do(func() {
 | 
			
		||||
		instance = &Config{}
 | 
			
		||||
	})
 | 
			
		||||
	return instance
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user