func WithEnableResolutionFromAnchorOrigin(enable bool) Option {
	return func(opts *ResolveHandler) {
		opts.enableResolutionFromAnchorOrigin = enable
	}
}
WithEnableResolutionFromAnchorOrigin sets optional resolution from anchor origin flag.
package resolvehandler
import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"strings"
	"time"
	"github.com/hyperledger/aries-framework-go/spi/storage"
	"github.com/trustbloc/edge-core/pkg/log"
	"github.com/trustbloc/sidetree-core-go/pkg/api/operation"
	"github.com/trustbloc/sidetree-core-go/pkg/canonicalizer"
	"github.com/trustbloc/sidetree-core-go/pkg/document"
	"github.com/trustbloc/sidetree-core-go/pkg/docutil"
	"github.com/trustbloc/orb/pkg/context/common"
	"github.com/trustbloc/orb/pkg/discovery/endpoint/client/models"
	"github.com/trustbloc/orb/pkg/document/util"
	"github.com/trustbloc/orb/pkg/hashlink"
)
var logger = log.New("orb-resolver")
var ErrDocumentNotFound = fmt.Errorf("document not found")
type ResolveHandler struct {
	coreResolver coreResolver
	store        storage.Store
	anchorGraph  common.AnchorGraph
	metrics      metricsProvider
	discoveryService discoveryService
	remoteResolver   remoteResolver
	endpointClient   endpointClient
	namespace string
	domain    string
	unpublishedDIDLabel string
	enableDidDiscovery               bool
	enableResolutionFromAnchorOrigin bool
	enableCreateDocumentStore        bool
	hl *hashlink.HashLink
}
type coreResolver interface {
	ResolveDocument(idOrDocument string, additionalOps ...*operation.AnchoredOperation) (*document.ResolutionResult, error)
}
type discoveryService interface {
	RequestDiscovery(id string) error
}
type endpointClient interface {
	GetEndpointFromAnchorOrigin(did string) (*models.Endpoint, error)
}
type remoteResolver interface {
	ResolveDocumentFromResolutionEndpoints(id string, endpoints []string) (*document.ResolutionResult, error)
}
type metricsProvider interface {
	DocumentResolveTime(duration time.Duration)
}
type Option func(opts *ResolveHandler)
func WithEnableDIDDiscovery(enable bool) Option {
	return func(opts *ResolveHandler) {
		opts.enableDidDiscovery = enable
	}
}