/*
initLease initializes the lease on the etcd service which will be used to export
ports in the future.
*/
initLease initializes the lease on the etcd service which will be used to export
ports in the future.
/ * initLease initializes the lease on the etcd service which will be used to export ports in the future . * /
func (e *ServiceExporter) initLease(ctx context.Context, ttl int64) error {
	var lease *etcd.LeaseGrantResponse
	var err error
	if lease, err = e.lease.Grant(ctx, ttl); err != nil {
		return err
	}
	e.keepaliveResponses, err = e.lease.KeepAlive(
		context.Background(), lease.ID)
	e.leaseID = lease.ID
	if err != nil {
		log.Print("Error establishing keepalive: ", err)
	}
	go consumeKeepaliveResponses(e.keepaliveResponses)
	return nil
}
func ( e * ServiceExporter ) initLease ( ctx context . Context , ttl int64 ) error { var lease * etcd . LeaseGrantResponse var err error if lease , err = e . lease . Grant ( ctx , ttl ) ; err != nil { return err } e . keepaliveResponses , err = e . lease . KeepAlive ( context . Background ( ) , lease . ID ) e . leaseID = lease . ID if err != nil { log . Print ( " " , err ) } go consumeKeepaliveResponses ( e . keepaliveResponses ) return nil }
initLease initializes the lease on the etcd service which will be used to export
ports in the future.
initLease initializes the lease on the etcd service which will be used to export ports in the future .