82
request *historyservice.GetWorkflowExecutionRawHistoryRequest,
83
versionHistories *historyspb.VersionHistories,
84
>
) *tokenspb.RawHistoryContinuation {
token.go
85
>
86
>
req := request.Request
87
>
execution := req.Execution
88
>
return &tokenspb.RawHistoryContinuation{
89
>
NamespaceId: req.GetNamespaceId(),
90
>
WorkflowId: execution.GetWorkflowId(),
91
>
RunId: execution.GetRunId(),
92
>
StartEventId: req.GetStartEventId(),
93
>
StartEventVersion: req.GetStartEventVersion(),
94
>
EndEventId: req.GetEndEventId(),
95
>
EndEventVersion: req.GetEndEventVersion(),
96
>
VersionHistories: versionHistories,
97
>
PersistenceToken: nil, // this is the initialized value
98
>
}
99
>
}
100
101
func ValidatePaginationToken(
102
request *historyservice.GetWorkflowExecutionRawHistoryRequest,
103
token *tokenspb.RawHistoryContinuation,
105
>
106
>
req := request.Request
107
>
execution := req.Execution
108
>
if req.GetNamespaceId() != token.GetNamespaceId() ||
109
>
execution.GetWorkflowId() != token.GetWorkflowId() ||
110
>
execution.GetRunId() != token.GetRunId() ||
111
>
req.GetStartEventId() != token.GetStartEventId() ||
112
>
req.GetStartEventVersion() != token.GetStartEventVersion() ||
113
>
req.GetEndEventId() != token.GetEndEventId() ||
114
>
req.GetEndEventVersion() != token.GetEndEventVersion() {
115
return consts.ErrInvalidPaginationToken
116
}
118
}