github.com/netdata/go.d.plugin@v0.58.1/modules/whoisquery/init.go (about)

     1  // SPDX-License-Identifier: GPL-3.0-or-later
     2  
     3  package whoisquery
     4  
     5  import (
     6  	"errors"
     7  
     8  	"github.com/netdata/go.d.plugin/agent/module"
     9  )
    10  
    11  func (w *WhoisQuery) validateConfig() error {
    12  	if w.Source == "" {
    13  		return errors.New("source is not set")
    14  	}
    15  	return nil
    16  }
    17  
    18  func (w *WhoisQuery) initProvider() (provider, error) {
    19  	return newProvider(w.Config)
    20  }
    21  
    22  func (w *WhoisQuery) initCharts() *module.Charts {
    23  	charts := baseCharts.Copy()
    24  
    25  	for _, chart := range *charts {
    26  		chart.Labels = []module.Label{
    27  			{Key: "domain", Value: w.Source},
    28  		}
    29  	}
    30  
    31  	return charts
    32  }