influxdb2
This commit is contained in:
		
							parent
							
								
									bc9c6c5ce3
								
							
						
					
					
						commit
						46882eb4ce
					
				| 
						 | 
				
			
			@ -14,8 +14,9 @@ type Config struct {
 | 
			
		|||
 | 
			
		||||
func NewConfg() *Config {
 | 
			
		||||
	return &Config{
 | 
			
		||||
		Address:  "10.0.1.15:17000",
 | 
			
		||||
		Address:  "http://10.0.0.131:8086",
 | 
			
		||||
		Interval: 10,
 | 
			
		||||
		Database: "telegraf",
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -28,12 +29,3 @@ func Init(c *Config) error {
 | 
			
		|||
	go serv.run()
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *Config) Default() {
 | 
			
		||||
	if c.Database == "" {
 | 
			
		||||
		c.Database = "telegraf"
 | 
			
		||||
	}
 | 
			
		||||
	if c.Interval == 0 {
 | 
			
		||||
		c.Interval = 10
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,6 @@ type service struct {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
func NewService(c *Config) *service {
 | 
			
		||||
	c.Default()
 | 
			
		||||
	hostname, _ := os.Hostname()
 | 
			
		||||
 | 
			
		||||
	infUrl, _ := url.Parse(c.Address)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue