// ResolveDocument resolves a document.
ResolveDocument resolves a document.
// ResolveDocument resolves a document .
func (r *ResolveHandler) ResolveDocument(id string) (*document.ResolutionResult, error) {
	startTime := time.Now()
	defer func() {
		r.metrics.DocumentResolveTime(time.Since(startTime))
	}()
	localResponse, err := r.resolveDocumentLocally(id)
	if err != nil {
		return nil, err
	}
	if r.enableResolutionFromAnchorOrigin && !strings.Contains(id, r.unpublishedDIDLabel) {
		return r.resolveDocumentFromAnchorOriginAndCombineWithLocal(id, localResponse)
	}
	return localResponse, nil
}
func ( r * ResolveHandler ) ResolveDocument ( id string ) ( * document . ResolutionResult , error ) { startTime := time . Now ( ) defer func ( ) { r . metrics . DocumentResolveTime ( time . Since ( startTime ) ) } ( ) localResponse , err := r . resolveDocumentLocally ( id ) if err != nil { return nil , err } if r . enableResolutionFromAnchorOrigin && ! strings . Contains ( id , r . unpublishedDIDLabel ) { return r . resolveDocumentFromAnchorOriginAndCombineWithLocal ( id , localResponse ) } return localResponse , nil }
ResolveDocument resolves a document.
ResolveDocument resolves a document .