/*
NewExporter creates a new exporter object which can later be used to create
exported ports and services. This will create a client connection to etcd.
If the connection is severed, once the etcd lease is going to expire the
port will stop being exported.
The specified ttl (which must be at least 5 (seconds)) determines how
frequently the lease will be renewed.
*/
NewExporter creates a new exporter object which can later be used to create
exported ports and services. This will create a client connection to etcd.
If the connection is severed, once the etcd lease is going to expire the
port will stop being exported.
The specified ttl (which must be at least 5 (seconds)) determines how
frequently the lease will be renewed.
/ * NewExporter creates a new exporter object which can later be used to create exported ports and services . This will create a client connection to etcd . If the connection is severed once the etcd lease is going to expire the port will stop being exported . The specified ttl ( which must be at least 5 ( seconds )) determines how frequently the lease will be renewed . * /
func NewExporter(ctx context.Context, etcdURL string, ttl int64) (
	*ServiceExporter, error) {
	var self *ServiceExporter
	var client *etcd.Client
	var err error
	if client, err = etcd.NewFromURL(etcdURL); err != nil {
		return nil, err
	}
	self = &ServiceExporter{
		kv:    client,
		lease: client,
	}
	return self, self.initLease(ctx, ttl)
}
func NewExporter ( ctx context . Context , etcdURL string , ttl int64 ) ( * ServiceExporter , error ) { var self * ServiceExporter var client * etcd . Client var err error if client , err = etcd . NewFromURL ( etcdURL ) ; err != nil { return nil , err } self = & ServiceExporter { kv : client , lease : client , } return self , self . initLease ( ctx , ttl ) }
NewExporter creates a new exporter object which can later be used to create
exported ports and services.
NewExporter creates a new exporter object which can later be used to create exported ports and services .