func (r *Registry) Close() error {
	for _, v := range r.vdr {
		if err := v.Close(); err != nil {
			return fmt.Errorf("close vdr: %w", err)
		}
	}
	return nil
}
Close frees resources being maintained by vdr.
package vdr
import (
	"errors"
	"fmt"
	"strings"
	diddoc "github.com/hyperledger/aries-framework-go/pkg/doc/did"
	vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr"
	"github.com/hyperledger/aries-framework-go/pkg/vdr/peer"
)
type Option func(opts *Registry)
type Registry struct {
	vdr                []vdrapi.VDR
	defServiceEndpoint string
	defServiceType     string
}
func New(opts ...Option) *Registry {
	baseVDR := &Registry{}
	for _, opt := range opts {
		opt(baseVDR)
	}
	return baseVDR
}
func (r *Registry) Resolve(did string, opts ...vdrapi.DIDMethodOption) (*diddoc.DocResolution, error) {
	didMethod, err := GetDidMethod(did)
	if err != nil {
		return nil, err
	}
	method, err := r.resolveVDR(didMethod)
	if err != nil {
		return nil, err
	}
	didDocResolution, err := method.Read(did, opts...)
	if err != nil {
		if errors.Is(err, vdrapi.ErrNotFound) {
			return nil, err
		}
		return nil, fmt.Errorf("did method read failed failed: %w", err)
	}
	return didDocResolution, nil
}
func (r *Registry) Update(didDoc *diddoc.Doc, opts ...vdrapi.DIDMethodOption) error {
	didMethod, err := GetDidMethod(didDoc.ID)
	if err != nil {
		return err
	}
	method, err := r.resolveVDR(didMethod)
	if err != nil {
		return err
	}
	return method.Update(didDoc, opts...)
}
func (r *Registry) Deactivate(did string, opts ...vdrapi.DIDMethodOption) error {
	didMethod, err := GetDidMethod(did)
	if err != nil {
		return err
	}
	method, err := r.resolveVDR(didMethod)
	if err != nil {
		return err
	}
	return method.Deactivate(did, opts...)
}
func (r *Registry) Create(didMethod string, did *diddoc.Doc,
	opts ...vdrapi.DIDMethodOption) (*diddoc.DocResolution, error) {
	docOpts := &vdrapi.DIDMethodOpts{Values: make(map[string]interface{})}
	for _, opt := range opts {
		opt(docOpts)
	}
	method, err := r.resolveVDR(didMethod)
	if err != nil {
		return nil, err
	}
	didDocResolution, err := method.Create(did, r.applyDefaultDocOpts(docOpts, opts...)...)
	if err != nil {
		return nil, err
	}
	return didDocResolution, nil
}
func (r *Registry) applyDefaultDocOpts(docOpts *vdrapi.DIDMethodOpts,
	opts ...vdrapi.DIDMethodOption) []vdrapi.DIDMethodOption {
	if docOpts.Values[peer.DefaultServiceType] == nil {
		opts = append(opts, vdrapi.WithOption(peer.DefaultServiceType, r.defServiceType))
	}
	if docOpts.Values[peer.DefaultServiceEndpoint] == nil {
		opts = append(opts, vdrapi.WithOption(peer.DefaultServiceEndpoint, r.defServiceEndpoint))
	}
	return opts
}