func (r *WorkflowReplayer) RegisterWorkflow(w interface{}) {
	r.registry.RegisterWorkflow(w)
}
RegisterWorkflow registers workflow function to replay
package internal
import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io/ioutil"
	"math"
	"github.com/golang/mock/gomock"
	"github.com/opentracing/opentracing-go"
	"github.com/pborman/uuid"
	"github.com/uber-go/tally"
	"go.uber.org/cadence/.gen/go/cadence/workflowserviceclient"
	"go.uber.org/cadence/.gen/go/cadence/workflowservicetest"
	"go.uber.org/cadence/.gen/go/shared"
	"go.uber.org/cadence/internal/common"
	"go.uber.org/cadence/internal/common/backoff"
	"go.uber.org/cadence/internal/common/serializer"
	"go.uber.org/zap"
)
const (
	replayDomainName             = "ReplayDomain"
	replayTaskListName           = "ReplayTaskList"
	replayWorkflowID             = "ReplayId"
	replayWorkerIdentity         = "replayID"
	replayPreviousStartedEventID = math.MaxInt64
	replayTaskToken              = "ReplayTaskToken"
)
var (
	errReplayEmptyHistory          = errors.New("empty events")
	errReplayHistoryTooShort       = errors.New("at least 3 events expected in the history")
	errReplayInvalidFirstEvent     = errors.New("first event is not WorkflowExecutionStarted")
	errReplayCorruptedStartedEvent = errors.New("corrupted WorkflowExecutionStarted")
)
type WorkflowReplayer struct {
	registry *registry
	options  ReplayOptions
}
type ReplayOptions struct {
	DataConverter DataConverter
	WorkflowInterceptorChainFactories []WorkflowInterceptorFactory
	ContextPropagators []ContextPropagator
	Tracer opentracing.Tracer
	FeatureFlags FeatureFlags
}
func IsReplayDomain(dn string) bool {
	return replayDomainName == dn
}
func NewWorkflowReplayer() *WorkflowReplayer {
	return NewWorkflowReplayerWithOptions(ReplayOptions{})
}
func NewWorkflowReplayerWithOptions(
	options ReplayOptions,
) *WorkflowReplayer {
	augmentReplayOptions(&options)
	return &WorkflowReplayer{
		registry: newRegistry(),
		options:  options,
	}
}