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
}
DeleteLinks deletes the given hash links.
package linkstore
import (
	"encoding/base64"
	"encoding/json"
	"fmt"
	"net/url"
	"github.com/hyperledger/aries-framework-go/spi/storage"
	"github.com/trustbloc/edge-core/pkg/log"
	orberrors "github.com/trustbloc/orb/pkg/errors"
	"github.com/trustbloc/orb/pkg/hashlink"
)
const (
	storeName = "anchorlink"
	hashTag   = "anchorHash"
)
var logger = log.New("anchorlinkstore")
func New(provider storage.Provider) (*Store, error) {
	store, err := provider.OpenStore(storeName)
	if err != nil {
		return nil, fmt.Errorf("failed to open anchor link store: %w", err)
	}
	err = provider.SetStoreConfig(storeName, storage.StoreConfiguration{TagNames: []string{hashTag}})
	if err != nil {
		return nil, fmt.Errorf("failed to set store configuration: %w", err)
	}
	return &Store{
		store:     store,
		marshal:   json.Marshal,
		unmarshal: json.Unmarshal,
	}, nil
}
type Store struct {
	store     storage.Store
	marshal   func(interface{}) ([]byte, error)
	unmarshal func(data []byte, v interface{}) error
}
func (s *Store) PutLinks(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("Storing anchor link for hash [%s]: [%s]", anchorHash, linkBytes)
		operations[i] = storage.Operation{
			Key:   getID(link),
			Value: linkBytes,
			Tags: []storage.Tag{
				{
					Name:  hashTag,
					Value: anchorHash,
				},
			},
		}
	}
	err := s.store.Batch(operations)
	if err != nil {
		return orberrors.NewTransient(fmt.Errorf("store anchor links: %w", err))
	}
	return nil
}