code: func (p *Plugin) Init() (err error) {
  	if p.Config == nil {
  		p.Config, err = p.getConfig()
  		if err != nil || p.disabled {
  			return err
  		}
  	}
  
  	clientCfg, err := ConfigToClient(p.Config)
  	if err != nil {
  		return err
  	}
  	p.client, err = NewClient(clientCfg)
  	if err != nil {
  		p.Log.Errorf("Err: %v", err)
  		return err
  	}
  
  	p.reconnectResync = p.Config.ReconnectResync
  	p.protoWrapper = kvproto.NewProtoWrapper(p.client, &keyval.SerializerJSON{})
  
  	// Register for providing status reports (polling mode)
  	if p.StatusCheck != nil {
  		p.StatusCheck.Register(p.PluginName, p.statusCheckProbe)
  	} else {
  		p.Log.Warnf("Unable to start status check for consul")
  	}
  
  	return nil
  }
docs: // Init initializes Consul plugin.