func (r VaultService) renew(rn *watchedResource) error {
	glog.V(4).Infof("attempting to renew the lease: %s on resource: %s", rn.secret.LeaseID, rn.resource)
	// step: check the resource is renewable
	if !rn.secret.Renewable {
		return fmt.Errorf("the resource: %s is not renewable", rn.resource)
	}

	secret, err := r.client.Sys().Renew(rn.secret.LeaseID, 0)
	if err != nil {
		return err
	}

	// step: update the resource
	rn.lastUpdated = time.Now()
	rn.leaseExpireTime = rn.lastUpdated.Add(time.Duration(secret.LeaseDuration))

	glog.V(3).Infof("renewed resource: %s, leaseId: %s, lease_time: %s, expiration: %s",
		rn.resource, rn.secret.LeaseID, rn.secret.LeaseID, rn.leaseExpireTime)

	return nil
}
// renew attempts to renew the lease on a resource
// 	rn			: the resource we wish to renew the lease on
renew attempts to renew the lease on a resource
rn			: the resource we wish to renew the lease on
// renew attempts to renew the lease on a resource // rn : the resource we wish to renew the lease on
func (r VaultService) renew(rn *watchedResource) error {
	glog.V(4).Infof("attempting to renew the lease: %s on resource: %s", rn.secret.LeaseID, rn.resource)
	if !rn.secret.Renewable {
		return fmt.Errorf("the resource: %s is not renewable", rn.resource)
	}
	secret, err := r.client.Sys().Renew(rn.secret.LeaseID, 0)
	if err != nil {
		return err
	}
	rn.lastUpdated = time.Now()
	rn.leaseExpireTime = rn.lastUpdated.Add(time.Duration(secret.LeaseDuration))
	glog.V(3).Infof("renewed resource: %s, leaseId: %s, lease_time: %s, expiration: %s",
		rn.resource, rn.secret.LeaseID, rn.secret.LeaseID, rn.leaseExpireTime)
	return nil
}
func ( r VaultService ) renew ( rn * watchedResource ) error { glog . V ( 4 ) . Infof ( " " , rn . secret . LeaseID , rn . resource ) if ! rn . secret . Renewable { return fmt . Errorf ( " " , rn . resource ) } secret , err := r . client . Sys ( ) . Renew ( rn . secret . LeaseID , 0 ) if err != nil { return err } rn . lastUpdated = time . Now ( ) rn . leaseExpireTime = rn . lastUpdated . Add ( time . Duration ( secret . LeaseDuration ) ) glog . V ( 3 ) . Infof ( " " , rn . resource , rn . secret . LeaseID , rn . secret . LeaseID , rn . leaseExpireTime ) return nil }
renew attempts to renew the lease on a resource
rn			: the resource we wish to renew the lease on
renew attempts to renew the lease on a resource rn : the resource we wish to renew the lease on
// step: check the resource is renewable // step: update the resource