func (cfg Configuration) NewClient(iopts instrument.Options) (client.Client, error) {
	return NewConfigServiceClient(cfg.NewOptions().SetInstrumentOptions(iopts))
}
NewClient creates a new config service client.
package etcd
import (
	"time"
	"github.com/m3db/m3cluster/client"
	"github.com/m3db/m3cluster/services"
	"github.com/m3db/m3x/instrument"
)
type ClusterConfig struct {
	Zone      string           `yaml:"zone"`
	Endpoints []string         `yaml:"endpoints"`
	KeepAlive *keepAliveConfig `yaml:"keepAlive"`
	TLS       *TLSConfig       `yaml:"tls"`
}
func (c ClusterConfig) NewCluster() Cluster {
	keepAliveOpts := NewKeepAliveOptions()
	if c.KeepAlive != nil {
		keepAliveOpts = c.KeepAlive.NewOptions()
	}
	return NewCluster().
		SetZone(c.Zone).
		SetEndpoints(c.Endpoints).
		SetKeepAliveOptions(keepAliveOpts).
		SetTLSOptions(c.TLS.newOptions())
}
type TLSConfig struct {
	CrtPath   string `yaml:"crtPath"`
	CACrtPath string `yaml:"caCrtPath"`
	KeyPath   string `yaml:"keyPath"`
}
func (c *TLSConfig) newOptions() TLSOptions {
	opts := NewTLSOptions()
	if c == nil {
		return opts
	}
	return opts.
		SetCrtPath(c.CrtPath).
		SetKeyPath(c.KeyPath).
		SetCACrtPath(c.CACrtPath)
}
type keepAliveConfig struct {
	Enabled bool          `yaml:"enabled"`
	Period  time.Duration `yaml:"period"`
	Jitter  time.Duration `yaml:"jitter"`
	Timeout time.Duration `yaml:"timeout"`
}
func (c *keepAliveConfig) NewOptions() KeepAliveOptions {
	return NewKeepAliveOptions().
		SetKeepAliveEnabled(c.Enabled).
		SetKeepAlivePeriod(c.Period).
		SetKeepAlivePeriodMaxJitter(c.Jitter).
		SetKeepAliveTimeout(c.Timeout)
}
type Configuration struct {
	Zone              string                 `yaml:"zone"`
	Env               string                 `yaml:"env"`
	Service           string                 `yaml:"service" validate:"nonzero"`
	CacheDir          string                 `yaml:"cacheDir"`
	ETCDClusters      []ClusterConfig        `yaml:"etcdClusters"`
	SDConfig          services.Configuration `yaml:"m3sd"`
	WatchWithRevision int64                  `yaml:"watchWithRevision"`
}