// DeleteLinks deletes the given hash links.
DeleteLinks deletes the given hash links.
// DeleteLinks deletes the given hash links .
func (s *Store) DeleteLinks(links []*url.URL) error {
	operations := make([]storage.Operation, len(links))
	for i, link := range links {
		anchorHash, err := hashlink.GetResourceHashFromHashLink(link.String())
		if err != nil {
			return fmt.Errorf("get hash from hashlink [%s]: %w", link, err)
		}
		linkBytes, err := s.marshal(link.String())
		if err != nil {
			return fmt.Errorf("marshal anchor link [%s]: %w", link, err)
		}
		logger.Debugf("Deleting anchor link for hash [%s]: [%s]", anchorHash, linkBytes)
		operations[i] = storage.Operation{
			Key: getID(link),
		}
	}
	err := s.store.Batch(operations)
	if err != nil {
		return orberrors.NewTransient(fmt.Errorf("delete anchor links: %w", err))
	}
	return nil
}
func ( s * Store ) DeleteLinks ( links [ ] * url . URL ) error { operations := make ( [ ] storage . Operation , len ( links ) ) for i , link := range links { anchorHash , err := hashlink . GetResourceHashFromHashLink ( link . String ( ) ) if err != nil { return fmt . Errorf ( " " , link , err ) } linkBytes , err := s . marshal ( link . String ( ) ) if err != nil { return fmt . Errorf ( " " , link , err ) } logger . Debugf ( " " , anchorHash , linkBytes ) operations [ i ] = storage . Operation { Key : getID ( link ) , } } err := s . store . Batch ( operations ) if err != nil { return orberrors . NewTransient ( fmt . Errorf ( " " , err ) ) } return nil }
DeleteLinks deletes the given hash links.
DeleteLinks deletes the given hash links .