• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber-go / cadence-client / 018c00e0-d6d2-44e5-aa77-74f47be0fdb8

24 Nov 2023 10:38AM UTC coverage: 64.703% (-0.05%) from 64.757%
018c00e0-d6d2-44e5-aa77-74f47be0fdb8

push

buildkite

13213 of 20421 relevant lines covered (64.7%)

316.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

48.42
/internal/compatibility/thrift/types.go
1
// Copyright (c) 2021 Uber Technologies, Inc.
2
//
3
// Permission is hereby granted, free of charge, to any person obtaining a copy
4
// of this software and associated documentation files (the "Software"), to deal
5
// in the Software without restriction, including without limitation the rights
6
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
// copies of the Software, and to permit persons to whom the Software is
8
// furnished to do so, subject to the following conditions:
9
//
10
// The above copyright notice and this permission notice shall be included in
11
// all copies or substantial portions of the Software.
12
//
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
// THE SOFTWARE.
20

21
package thrift
22

23
import (
24
        "go.uber.org/cadence/.gen/go/shared"
25
        "go.uber.org/cadence/internal/common"
26

27
        apiv1 "github.com/uber/cadence-idl/go/proto/api/v1"
28
)
29

30
func Payload(p *apiv1.Payload) []byte {
411✔
31
        if p == nil {
665✔
32
                return nil
254✔
33
        }
254✔
34
        if p.Data == nil {
157✔
35
                // protoPayload will not generate this case
×
36
                // however, Data field will be dropped by the encoding if it's empty
×
37
                // and receiver side will see nil for the Data field
×
38
                // since we already know p is not nil, Data field must be an empty byte array
×
39
                return []byte{}
×
40
        }
×
41
        return p.Data
157✔
42
}
43

44
func Domain(domain string) *string {
111✔
45
        if domain == "" {
178✔
46
                return nil
67✔
47
        }
67✔
48
        return &domain
44✔
49
}
50

51
func FailureReason(failure *apiv1.Failure) *string {
111✔
52
        if failure == nil {
178✔
53
                return nil
67✔
54
        }
67✔
55
        return &failure.Reason
44✔
56
}
57

58
func FailureDetails(failure *apiv1.Failure) []byte {
295✔
59
        if failure == nil {
423✔
60
                return nil
128✔
61
        }
128✔
62
        return failure.Details
167✔
63
}
167✔
64

167✔
65
func WorkflowExecution(t *apiv1.WorkflowExecution) *shared.WorkflowExecution {
167✔
66
        if t == nil {
67
                return nil
68
        }
×
69
        return &shared.WorkflowExecution{
×
70
                WorkflowId: &t.WorkflowId,
×
71
                RunId:      &t.RunId,
×
72
        }
×
73
}
74

75
func WorkflowID(t *apiv1.WorkflowExecution) *string {
×
76
        if t == nil {
×
77
                return nil
×
78
        }
×
79
        return &t.WorkflowId
×
80
}
81

82
func RunID(t *apiv1.WorkflowExecution) *string {
103✔
83
        if t == nil {
167✔
84
                return nil
64✔
85
        }
64✔
86
        return &t.RunId
39✔
87
}
39✔
88

39✔
89
func ActivityType(t *apiv1.ActivityType) *shared.ActivityType {
90
        if t == nil {
91
                return nil
357✔
92
        }
485✔
93
        return &shared.ActivityType{
128✔
94
                Name: &t.Name,
128✔
95
        }
229✔
96
}
229✔
97

229✔
98
func AutoConfigHint(t *apiv1.AutoConfigHint) *shared.AutoConfigHint {
99
        if t == nil {
100
                return nil
408✔
101
        }
472✔
102
        return &shared.AutoConfigHint{
64✔
103
                EnableAutoConfig:   &t.EnableAutoConfig,
64✔
104
                PollerWaitTimeInMs: &t.PollerWaitTimeInMs,
344✔
105
        }
344✔
106
}
344✔
107

344✔
108
func WorkflowType(t *apiv1.WorkflowType) *shared.WorkflowType {
109
        if t == nil {
110
                return nil
×
111
        }
×
112
        return &shared.WorkflowType{
×
113
                Name: &t.Name,
×
114
        }
×
115
}
×
116

×
117
func TaskList(t *apiv1.TaskList) *shared.TaskList {
118
        if t == nil {
119
                return nil
102✔
120
        }
191✔
121
        return &shared.TaskList{
89✔
122
                Name: &t.Name,
89✔
123
                Kind: TaskListKind(t.Kind),
13✔
124
        }
13✔
125
}
13✔
126

13✔
127
func TaskListMetadata(t *apiv1.TaskListMetadata) *shared.TaskListMetadata {
13✔
128
        if t == nil {
13✔
129
                return nil
13✔
130
        }
13✔
131
        return &shared.TaskListMetadata{
132
                MaxTasksPerSecond: toDoubleValue(t.MaxTasksPerSecond),
133
        }
194✔
134
}
258✔
135

64✔
136
func RetryPolicy(t *apiv1.RetryPolicy) *shared.RetryPolicy {
64✔
137
        if t == nil {
130✔
138
                return nil
130✔
139
        }
130✔
140
        return &shared.RetryPolicy{
141
                InitialIntervalInSeconds:    durationToSeconds(t.InitialInterval),
142
                BackoffCoefficient:          &t.BackoffCoefficient,
85✔
143
                MaximumIntervalInSeconds:    durationToSeconds(t.MaximumInterval),
156✔
144
                MaximumAttempts:             &t.MaximumAttempts,
71✔
145
                NonRetriableErrorReasons:    t.NonRetryableErrorReasons,
71✔
146
                ExpirationIntervalInSeconds: durationToSeconds(t.ExpirationInterval),
14✔
147
        }
14✔
148
}
14✔
149

150
func Header(t *apiv1.Header) *shared.Header {
151
        if t == nil {
85✔
152
                return nil
156✔
153
        }
71✔
154
        return &shared.Header{
71✔
155
                Fields: PayloadMap(t.Fields),
14✔
156
        }
14✔
157
}
14✔
158

159
func Memo(t *apiv1.Memo) *shared.Memo {
160
        if t == nil {
98✔
161
                return nil
98✔
162
        }
×
163
        return &shared.Memo{
×
164
                Fields: PayloadMap(t.Fields),
98✔
165
        }
98✔
166
}
98✔
167

168
func SearchAttributes(t *apiv1.SearchAttributes) *shared.SearchAttributes {
169
        if t == nil {
×
170
                return nil
×
171
        }
×
172
        return &shared.SearchAttributes{
×
173
                IndexedFields: PayloadMap(t.IndexedFields),
×
174
        }
×
175
}
×
176

×
177
func BadBinaries(t *apiv1.BadBinaries) *shared.BadBinaries {
×
178
        if t == nil {
179
                return nil
180
        }
98✔
181
        return &shared.BadBinaries{
98✔
182
                Binaries: BadBinaryInfoMap(t.Binaries),
×
183
        }
×
184
}
98✔
185

98✔
186
func BadBinaryInfo(t *apiv1.BadBinaryInfo) *shared.BadBinaryInfo {
98✔
187
        if t == nil {
188
                return nil
189
        }
177✔
190
        return &shared.BadBinaryInfo{
350✔
191
                Reason:          &t.Reason,
173✔
192
                Operator:        &t.Operator,
173✔
193
                CreatedTimeNano: timeToUnixNano(t.CreatedTime),
4✔
194
        }
4✔
195
}
4✔
196

4✔
197
func ClusterReplicationConfiguration(t *apiv1.ClusterReplicationConfiguration) *shared.ClusterReplicationConfiguration {
198
        if t == nil {
199
                return nil
×
200
        }
×
201
        return &shared.ClusterReplicationConfiguration{
×
202
                ClusterName: &t.ClusterName,
×
203
        }
×
204
}
×
205

×
206
func WorkflowQuery(t *apiv1.WorkflowQuery) *shared.WorkflowQuery {
×
207
        if t == nil {
×
208
                return nil
209
        }
210
        return &shared.WorkflowQuery{
×
211
                QueryType: &t.QueryType,
×
212
                QueryArgs: Payload(t.QueryArgs),
×
213
        }
×
214
}
×
215

×
216
func WorkflowQueryResult(t *apiv1.WorkflowQueryResult) *shared.WorkflowQueryResult {
×
217
        if t == nil {
×
218
                return nil
219
        }
220
        return &shared.WorkflowQueryResult{
×
221
                ResultType:   QueryResultType(t.ResultType),
×
222
                Answer:       Payload(t.Answer),
×
223
                ErrorMessage: &t.ErrorMessage,
×
224
        }
×
225
}
×
226

×
227
func StickyExecutionAttributes(t *apiv1.StickyExecutionAttributes) *shared.StickyExecutionAttributes {
×
228
        if t == nil {
229
                return nil
230
        }
×
231
        return &shared.StickyExecutionAttributes{
×
232
                WorkerTaskList:                TaskList(t.WorkerTaskList),
×
233
                ScheduleToStartTimeoutSeconds: durationToSeconds(t.ScheduleToStartTimeout),
×
234
        }
×
235
}
×
236

×
237
func WorkerVersionInfo(t *apiv1.WorkerVersionInfo) *shared.WorkerVersionInfo {
×
238
        if t == nil {
239
                return nil
240
        }
×
241
        return &shared.WorkerVersionInfo{
×
242
                Impl:           &t.Impl,
×
243
                FeatureVersion: &t.FeatureVersion,
×
244
        }
×
245
}
×
246

×
247
func StartTimeFilter(t *apiv1.StartTimeFilter) *shared.StartTimeFilter {
×
248
        if t == nil {
249
                return nil
250
        }
×
251
        return &shared.StartTimeFilter{
×
252
                EarliestTime: timeToUnixNano(t.EarliestTime),
×
253
                LatestTime:   timeToUnixNano(t.LatestTime),
×
254
        }
×
255
}
×
256

×
257
func WorkflowExecutionFilter(t *apiv1.WorkflowExecutionFilter) *shared.WorkflowExecutionFilter {
258
        if t == nil {
259
                return nil
×
260
        }
×
261
        return &shared.WorkflowExecutionFilter{
×
262
                WorkflowId: &t.WorkflowId,
×
263
                RunId:      &t.RunId,
×
264
        }
265
}
266

158✔
267
func WorkflowTypeFilter(t *apiv1.WorkflowTypeFilter) *shared.WorkflowTypeFilter {
291✔
268
        if t == nil {
133✔
269
                return nil
133✔
270
        }
25✔
271
        return &shared.WorkflowTypeFilter{
50✔
272
                Name: &t.Name,
25✔
273
        }
25✔
274
}
25✔
275

276
func StatusFilter(t *apiv1.StatusFilter) *shared.WorkflowExecutionCloseStatus {
277
        if t == nil {
98✔
278
                return nil
196✔
279
        }
98✔
280
        return WorkflowExecutionCloseStatus(t.Status)
98✔
281
}
×
282

×
283
func PayloadMap(t map[string]*apiv1.Payload) map[string][]byte {
×
284
        if t == nil {
×
285
                return nil
×
286
        }
287
        v := make(map[string][]byte, len(t))
288
        for key := range t {
98✔
289
                v[key] = Payload(t[key])
98✔
290
        }
×
291
        return v
×
292
}
98✔
293

196✔
294
func BadBinaryInfoMap(t map[string]*apiv1.BadBinaryInfo) map[string]*shared.BadBinaryInfo {
98✔
295
        if t == nil {
98✔
296
                return nil
98✔
297
        }
298
        v := make(map[string]*shared.BadBinaryInfo, len(t))
299
        for key := range t {
×
300
                v[key] = BadBinaryInfo(t[key])
×
301
        }
×
302
        return v
×
303
}
×
304

×
305
func ClusterReplicationConfigurationArray(t []*apiv1.ClusterReplicationConfiguration) []*shared.ClusterReplicationConfiguration {
×
306
        if t == nil {
×
307
                return nil
×
308
        }
309
        v := make([]*shared.ClusterReplicationConfiguration, len(t))
310
        for i := range t {
×
311
                v[i] = ClusterReplicationConfiguration(t[i])
×
312
        }
×
313
        return v
×
314
}
×
315

×
316
func WorkflowQueryResultMap(t map[string]*apiv1.WorkflowQueryResult) map[string]*shared.WorkflowQueryResult {
×
317
        if t == nil {
×
318
                return nil
319
        }
320
        v := make(map[string]*shared.WorkflowQueryResult, len(t))
2✔
321
        for key := range t {
3✔
322
                v[key] = WorkflowQueryResult(t[key])
1✔
323
        }
1✔
324
        return v
1✔
325
}
326

327
func DataBlob(t *apiv1.DataBlob) *shared.DataBlob {
2✔
328
        if t == nil {
3✔
329
                return nil
1✔
330
        }
1✔
331
        return &shared.DataBlob{
1✔
332
                EncodingType: EncodingType(t.EncodingType),
333
                Data:         t.Data,
334
        }
63✔
335
}
111✔
336

48✔
337
func ExternalInitiatedID(t *apiv1.ExternalExecutionInfo) *int64 {
48✔
338
        if t == nil {
15✔
339
                return nil
15✔
340
        }
15✔
341
        return &t.InitiatedId
342
}
343

15✔
344
func ExternalWorkflowExecution(t *apiv1.ExternalExecutionInfo) *shared.WorkflowExecution {
15✔
345
        if t == nil {
×
346
                return nil
×
347
        }
15✔
348
        return WorkflowExecution(t.WorkflowExecution)
15✔
349
}
15✔
350

15✔
351
func ResetPoints(t *apiv1.ResetPoints) *shared.ResetPoints {
15✔
352
        if t == nil {
15✔
353
                return nil
15✔
354
        }
15✔
355
        return &shared.ResetPoints{
356
                Points: ResetPointInfoArray(t.Points),
357
        }
×
358
}
×
359

×
360
func ResetPointInfo(t *apiv1.ResetPointInfo) *shared.ResetPointInfo {
×
361
        if t == nil {
×
362
                return nil
×
363
        }
×
364
        return &shared.ResetPointInfo{
×
365
                BinaryChecksum:           &t.BinaryChecksum,
×
366
                RunId:                    &t.RunId,
367
                FirstDecisionCompletedId: &t.FirstDecisionCompletedId,
368
                CreatedTimeNano:          timeToUnixNano(t.CreatedTime),
×
369
                ExpiringTimeNano:         timeToUnixNano(t.ExpiringTime),
×
370
                Resettable:               &t.Resettable,
×
371
        }
×
372
}
×
373

×
374
func PollerInfo(t *apiv1.PollerInfo) *shared.PollerInfo {
×
375
        if t == nil {
×
376
                return nil
×
377
        }
×
378
        return &shared.PollerInfo{
×
379
                LastAccessTime: timeToUnixNano(t.LastAccessTime),
380
                Identity:       &t.Identity,
381
                RatePerSecond:  &t.RatePerSecond,
×
382
        }
×
383
}
×
384

×
385
func TaskListStatus(t *apiv1.TaskListStatus) *shared.TaskListStatus {
×
386
        if t == nil {
×
387
                return nil
×
388
        }
×
389
        return &shared.TaskListStatus{
390
                BacklogCountHint: &t.BacklogCountHint,
391
                ReadLevel:        &t.ReadLevel,
3✔
392
                AckLevel:         &t.AckLevel,
3✔
393
                RatePerSecond:    &t.RatePerSecond,
×
394
                TaskIDBlock:      TaskIDBlock(t.TaskIdBlock),
×
395
        }
3✔
396
}
3✔
397

3✔
398
func TaskIDBlock(t *apiv1.TaskIDBlock) *shared.TaskIDBlock {
3✔
399
        if t == nil {
3✔
400
                return nil
401
        }
402
        return &shared.TaskIDBlock{
3✔
403
                StartID: &t.StartId,
3✔
404
                EndID:   &t.EndId,
×
405
        }
×
406
}
3✔
407

3✔
408
func WorkflowExecutionConfiguration(t *apiv1.WorkflowExecutionConfiguration) *shared.WorkflowExecutionConfiguration {
3✔
409
        if t == nil {
3✔
410
                return nil
3✔
411
        }
3✔
412
        return &shared.WorkflowExecutionConfiguration{
3✔
413
                TaskList:                            TaskList(t.TaskList),
3✔
414
                ExecutionStartToCloseTimeoutSeconds: durationToSeconds(t.ExecutionStartToCloseTimeout),
3✔
415
                TaskStartToCloseTimeoutSeconds:      durationToSeconds(t.TaskStartToCloseTimeout),
3✔
416
        }
3✔
417
}
3✔
418

3✔
419
func WorkflowExecutionInfo(t *apiv1.WorkflowExecutionInfo) *shared.WorkflowExecutionInfo {
3✔
420
        if t == nil {
3✔
421
                return nil
3✔
422
        }
423
        return &shared.WorkflowExecutionInfo{
424
                Execution:                    WorkflowExecution(t.WorkflowExecution),
3✔
425
                Type:                         WorkflowType(t.Type),
3✔
426
                StartTime:                    timeToUnixNano(t.StartTime),
×
427
                CloseTime:                    timeToUnixNano(t.CloseTime),
×
428
                CloseStatus:                  WorkflowExecutionCloseStatus(t.CloseStatus),
3✔
429
                HistoryLength:                &t.HistoryLength,
430
                ParentDomainId:               ParentDomainID(t.ParentExecutionInfo),
431
                ParentExecution:              ParentWorkflowExecution(t.ParentExecutionInfo),
60✔
432
                ExecutionTime:                timeToUnixNano(t.ExecutionTime),
104✔
433
                Memo:                         Memo(t.Memo),
44✔
434
                SearchAttributes:             SearchAttributes(t.SearchAttributes),
44✔
435
                AutoResetPoints:              ResetPoints(t.AutoResetPoints),
16✔
436
                TaskList:                     &t.TaskList,
437
                IsCron:                       &t.IsCron,
438
                CronOverlapPolicy:            CronOverlapPolicy(t.CronOverlapPolicy),
60✔
439
                ActiveClusterSelectionPolicy: ActiveClusterSelectionPolicy(t.ActiveClusterSelectionPolicy),
104✔
440
        }
44✔
441
}
44✔
442

16✔
443
func ParentDomainID(pei *apiv1.ParentExecutionInfo) *string {
444
        if pei == nil {
445
                return nil
63✔
446
        }
107✔
447
        return &pei.DomainId
44✔
448
}
44✔
449

19✔
450
func ParentDomainName(pei *apiv1.ParentExecutionInfo) *string {
451
        if pei == nil {
452
                return nil
3✔
453
        }
3✔
454
        return &pei.DomainName
×
455
}
×
456

3✔
457
func ParentInitiatedID(pei *apiv1.ParentExecutionInfo) *int64 {
3✔
458
        if pei == nil {
3✔
459
                return nil
3✔
460
        }
3✔
461
        return &pei.InitiatedId
3✔
462
}
3✔
463

3✔
464
func ParentWorkflowExecution(pei *apiv1.ParentExecutionInfo) *shared.WorkflowExecution {
3✔
465
        if pei == nil {
3✔
466
                return nil
3✔
467
        }
3✔
468
        return WorkflowExecution(pei.WorkflowExecution)
3✔
469
}
3✔
470

3✔
471
func PendingActivityInfo(t *apiv1.PendingActivityInfo) *shared.PendingActivityInfo {
472
        if t == nil {
473
                return nil
×
474
        }
×
475
        return &shared.PendingActivityInfo{
×
476
                ActivityID:             &t.ActivityId,
×
477
                ActivityType:           ActivityType(t.ActivityType),
×
478
                State:                  PendingActivityState(t.State),
×
479
                HeartbeatDetails:       Payload(t.HeartbeatDetails),
×
480
                LastHeartbeatTimestamp: timeToUnixNano(t.LastHeartbeatTime),
×
481
                LastStartedTimestamp:   timeToUnixNano(t.LastStartedTime),
×
482
                Attempt:                &t.Attempt,
×
483
                MaximumAttempts:        &t.MaximumAttempts,
×
484
                ScheduledTimestamp:     timeToUnixNano(t.ScheduledTime),
485
                ExpirationTimestamp:    timeToUnixNano(t.ExpirationTime),
486
                LastFailureReason:      FailureReason(t.LastFailure),
3✔
487
                LastFailureDetails:     FailureDetails(t.LastFailure),
6✔
488
                LastWorkerIdentity:     &t.LastWorkerIdentity,
3✔
489
        }
3✔
490
}
×
491

×
492
func PendingChildExecutionInfo(t *apiv1.PendingChildExecutionInfo) *shared.PendingChildExecutionInfo {
×
493
        if t == nil {
×
494
                return nil
×
495
        }
×
496
        return &shared.PendingChildExecutionInfo{
×
497
                WorkflowID:        WorkflowID(t.WorkflowExecution),
498
                RunID:             RunID(t.WorkflowExecution),
499
                WorkflowTypName:   &t.WorkflowTypeName,
29✔
500
                InitiatedID:       &t.InitiatedId,
29✔
501
                ParentClosePolicy: ParentClosePolicy(t.ParentClosePolicy),
×
502
        }
×
503
}
29✔
504

29✔
505
func PendingDecisionInfo(t *apiv1.PendingDecisionInfo) *shared.PendingDecisionInfo {
29✔
506
        if t == nil {
29✔
507
                return nil
29✔
508
        }
29✔
509
        return &shared.PendingDecisionInfo{
29✔
510
                State:                      PendingDecisionState(t.State),
511
                ScheduledTimestamp:         timeToUnixNano(t.ScheduledTime),
512
                StartedTimestamp:           timeToUnixNano(t.StartedTime),
×
513
                Attempt:                    common.Int64Ptr(int64(t.Attempt)),
×
514
                OriginalScheduledTimestamp: timeToUnixNano(t.OriginalScheduledTime),
×
515
        }
×
516
}
×
517

×
518
func ActivityLocalDispatchInfo(t *apiv1.ActivityLocalDispatchInfo) *shared.ActivityLocalDispatchInfo {
×
519
        if t == nil {
×
520
                return nil
521
        }
522
        return &shared.ActivityLocalDispatchInfo{
×
523
                ActivityId:                      &t.ActivityId,
×
524
                ScheduledTimestamp:              timeToUnixNano(t.ScheduledTime),
×
525
                StartedTimestamp:                timeToUnixNano(t.StartedTime),
×
526
                ScheduledTimestampOfThisAttempt: timeToUnixNano(t.ScheduledTimeOfThisAttempt),
×
527
                TaskToken:                       t.TaskToken,
×
528
        }
×
529
}
×
530

×
531
func SupportedClientVersions(t *apiv1.SupportedClientVersions) *shared.SupportedClientVersions {
×
532
        if t == nil {
×
533
                return nil
×
534
        }
×
535
        return &shared.SupportedClientVersions{
×
536
                GoSdk:   &t.GoSdk,
×
537
                JavaSdk: &t.JavaSdk,
×
538
        }
×
539
}
×
540

×
541
func DescribeDomainResponseDomain(t *apiv1.Domain) *shared.DescribeDomainResponse {
×
542
        if t == nil {
×
543
                return nil
×
544
        }
×
545
        return &shared.DescribeDomainResponse{
×
546
                DomainInfo: &shared.DomainInfo{
×
547
                        Name:        &t.Name,
×
548
                        Status:      DomainStatus(t.Status),
×
549
                        Description: &t.Description,
×
550
                        OwnerEmail:  &t.OwnerEmail,
×
551
                        Data:        t.Data,
552
                        UUID:        &t.Id,
553
                },
×
554
                Configuration: &shared.DomainConfiguration{
×
555
                        WorkflowExecutionRetentionPeriodInDays: durationToDays(t.WorkflowExecutionRetentionPeriod),
×
556
                        EmitMetric:                             boolPtr(true),
×
557
                        BadBinaries:                            BadBinaries(t.BadBinaries),
×
558
                        HistoryArchivalStatus:                  ArchivalStatus(t.HistoryArchivalStatus),
×
559
                        HistoryArchivalURI:                     &t.HistoryArchivalUri,
×
560
                        VisibilityArchivalStatus:               ArchivalStatus(t.VisibilityArchivalStatus),
×
561
                        VisibilityArchivalURI:                  &t.VisibilityArchivalUri,
562
                },
563
                ReplicationConfiguration: &shared.DomainReplicationConfiguration{
4✔
564
                        ActiveClusterName: &t.ActiveClusterName,
8✔
565
                        Clusters:          ClusterReplicationConfigurationArray(t.Clusters),
4✔
566
                        ActiveClusters:    ActiveClusters(t.ActiveClusters),
4✔
567
                },
×
568
                FailoverVersion: &t.FailoverVersion,
×
569
                IsGlobalDomain:  &t.IsGlobalDomain,
×
570
        }
571
}
572

×
573
func TaskListPartitionMetadata(t *apiv1.TaskListPartitionMetadata) *shared.TaskListPartitionMetadata {
×
574
        if t == nil {
×
575
                return nil
×
576
        }
×
577
        return &shared.TaskListPartitionMetadata{
×
578
                Key:           &t.Key,
×
579
                OwnerHostName: &t.OwnerHostName,
×
580
        }
×
581
}
582

583
func QueryRejected(t *apiv1.QueryRejected) *shared.QueryRejected {
15✔
584
        if t == nil {
15✔
585
                return nil
×
586
        }
×
587
        return &shared.QueryRejected{
15✔
588
                CloseStatus: WorkflowExecutionCloseStatus(t.CloseStatus),
30✔
589
        }
15✔
590
}
15✔
591

15✔
592
func PollerInfoArray(t []*apiv1.PollerInfo) []*shared.PollerInfo {
593
        if t == nil {
594
                return nil
3✔
595
        }
3✔
596
        v := make([]*shared.PollerInfo, len(t))
×
597
        for i := range t {
×
598
                v[i] = PollerInfo(t[i])
3✔
599
        }
6✔
600
        return v
3✔
601
}
3✔
602

3✔
603
func ResetPointInfoArray(t []*apiv1.ResetPointInfo) []*shared.ResetPointInfo {
604
        if t == nil {
605
                return nil
3✔
606
        }
6✔
607
        v := make([]*shared.ResetPointInfo, len(t))
3✔
608
        for i := range t {
3✔
609
                v[i] = ResetPointInfo(t[i])
×
610
        }
×
611
        return v
×
612
}
×
613

×
614
func PendingActivityInfoArray(t []*apiv1.PendingActivityInfo) []*shared.PendingActivityInfo {
615
        if t == nil {
616
                return nil
×
617
        }
×
618
        v := make([]*shared.PendingActivityInfo, len(t))
×
619
        for i := range t {
×
620
                v[i] = PendingActivityInfo(t[i])
×
621
        }
×
622
        return v
×
623
}
×
624

×
625
func PendingChildExecutionInfoArray(t []*apiv1.PendingChildExecutionInfo) []*shared.PendingChildExecutionInfo {
626
        if t == nil {
627
                return nil
36✔
628
        }
72✔
629
        v := make([]*shared.PendingChildExecutionInfo, len(t))
36✔
630
        for i := range t {
36✔
631
                v[i] = PendingChildExecutionInfo(t[i])
×
632
        }
×
633
        return v
×
634
}
×
635

×
636
func IndexedValueTypeMap(t map[string]apiv1.IndexedValueType) map[string]shared.IndexedValueType {
637
        if t == nil {
638
                return nil
×
639
        }
×
640
        v := make(map[string]shared.IndexedValueType, len(t))
×
641
        for key := range t {
×
642
                v[key] = IndexedValueType(t[key])
×
643
        }
×
644
        return v
×
645
}
×
646

×
647
func DataBlobArray(t []*apiv1.DataBlob) []*shared.DataBlob {
648
        if t == nil {
649
                return nil
×
650
        }
×
651
        v := make([]*shared.DataBlob, len(t))
×
652
        for i := range t {
×
653
                v[i] = DataBlob(t[i])
×
654
        }
×
655
        return v
×
656
}
×
657

×
658
func WorkflowExecutionInfoArray(t []*apiv1.WorkflowExecutionInfo) []*shared.WorkflowExecutionInfo {
659
        if t == nil {
660
                return nil
×
661
        }
×
662
        v := make([]*shared.WorkflowExecutionInfo, len(t))
×
663
        for i := range t {
×
664
                v[i] = WorkflowExecutionInfo(t[i])
×
665
        }
×
666
        return v
×
667
}
×
668

×
669
func DescribeDomainResponseArray(t []*apiv1.Domain) []*shared.DescribeDomainResponse {
670
        if t == nil {
671
                return nil
176✔
672
        }
351✔
673
        v := make([]*shared.DescribeDomainResponse, len(t))
175✔
674
        for i := range t {
175✔
675
                v[i] = DescribeDomainResponseDomain(t[i])
1✔
676
        }
2✔
677
        return v
1✔
678
}
1✔
679

1✔
680
func TaskListPartitionMetadataArray(t []*apiv1.TaskListPartitionMetadata) []*shared.TaskListPartitionMetadata {
681
        if t == nil {
682
                return nil
109✔
683
        }
189✔
684
        v := make([]*shared.TaskListPartitionMetadata, len(t))
80✔
685
        for i := range t {
80✔
686
                v[i] = TaskListPartitionMetadata(t[i])
29✔
687
        }
58✔
688
        return v
29✔
689
}
29✔
690

29✔
691
func WorkflowQueryMap(t map[string]*apiv1.WorkflowQuery) map[string]*shared.WorkflowQuery {
692
        if t == nil {
693
                return nil
694
        }
695
        v := make(map[string]*shared.WorkflowQuery, len(t))
696
        for key := range t {
697
                v[key] = WorkflowQuery(t[key])
698
        }
699
        return v
700
}
701

702
func ActivityLocalDispatchInfoMap(t map[string]*apiv1.ActivityLocalDispatchInfo) map[string]*shared.ActivityLocalDispatchInfo {
703
        if t == nil {
704
                return nil
705
        }
706
        v := make(map[string]*shared.ActivityLocalDispatchInfo, len(t))
707
        for key := range t {
708
                v[key] = ActivityLocalDispatchInfo(t[key])
709
        }
710
        return v
711
}
712

713
func ActiveClusters(ac *apiv1.ActiveClusters) *shared.ActiveClusters {
714
        if ac == nil {
715
                return nil
716
        }
717

718
        clByRegion := make(map[string]*shared.ActiveClusterInfo)
719
        for region, clInfo := range ac.RegionToCluster {
720
                clByRegion[region] = &shared.ActiveClusterInfo{
721
                        ActiveClusterName: &clInfo.ActiveClusterName,
722
                        FailoverVersion:   &clInfo.FailoverVersion,
723
                }
724
        }
725

726
        return &shared.ActiveClusters{
727
                ActiveClustersByRegion: clByRegion,
728
        }
729
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc