go.temporal.io/server/common/enums/defaults.go

75 LOC · 34 covered · 41 uncovered · 15 ranges · 243 concepts · 13 introducers · 116 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 package enums
2
3 import (
4 enumspb "go.temporal.io/api/enums/v1"
5 )
6
7 > func SetDefaultWorkflowIdReusePolicy(f *enumspb.WorkflowIdReusePolicy) { defaults.go ×1
8 > if *f == enumspb.WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED {
9 > *f = enumspb.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE defaults.go ×1
10 > }
11 }
12
13 // SetDefaultWorkflowIDPolicies migrates and applies defaults to both Workflow ID policies.
14 func SetDefaultWorkflowIDPolicies(
15 reusePolicy *enumspb.WorkflowIdReusePolicy,
16 conflictPolicy *enumspb.WorkflowIdConflictPolicy,
17 defaultConflictPolicy enumspb.WorkflowIdConflictPolicy,
18 > ) { defaults.go ×2
19 > // Set default conflict policy, if unset
20 > if *conflictPolicy == enumspb.WORKFLOW_ID_CONFLICT_POLICY_UNSPECIFIED {
21 > //nolint:staticcheck // SA1019: intentional migration of deprecated policy defaults.go ×2
22 > if *reusePolicy == enumspb.WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING {
23 > // Migrate the deprecated TERMINATE_IF_RUNNING. defaults.go ×1
24 > *conflictPolicy = enumspb.WORKFLOW_ID_CONFLICT_POLICY_TERMINATE_EXISTING
25 > *reusePolicy = enumspb.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE
26 > } else { defaults.go ×2
27 > *conflictPolicy = defaultConflictPolicy defaults.go ×1
28 > }
29 }
30
31 // Set default reuse policy, if unset
32 > SetDefaultWorkflowIdReusePolicy(reusePolicy) defaults.go ×2
33 }
34
35 > func SetDefaultHistoryEventFilterType(f *enumspb.HistoryEventFilterType) { workflow_handler.go ×9
36 > if *f == enumspb.HISTORY_EVENT_FILTER_TYPE_UNSPECIFIED {
37 *f = enumspb.HISTORY_EVENT_FILTER_TYPE_ALL_EVENT
38 }
39 }
40
41 > func SetDefaultTaskQueueKind(f *enumspb.TaskQueueKind) { defaults.go ×1
42 > if *f == enumspb.TASK_QUEUE_KIND_UNSPECIFIED {
43 > *f = enumspb.TASK_QUEUE_KIND_NORMAL defaults.go ×1
44 > }
45 }
46
47 > func SetDefaultParentClosePolicy(f *enumspb.ParentClosePolicy) { workflow_task_completed_handler.go ×14
48 > if *f == enumspb.PARENT_CLOSE_POLICY_UNSPECIFIED {
49 > *f = enumspb.PARENT_CLOSE_POLICY_TERMINATE defaults.go ×1
50 > }
51 }
52
53 func SetDefaultQueryRejectCondition(f *enumspb.QueryRejectCondition) {
54 if *f == enumspb.QUERY_REJECT_CONDITION_UNSPECIFIED {
55 *f = enumspb.QUERY_REJECT_CONDITION_NONE
56 }
57 }
58
59 func SetDefaultContinueAsNewInitiator(f *enumspb.ContinueAsNewInitiator) {
60 if *f == enumspb.CONTINUE_AS_NEW_INITIATOR_UNSPECIFIED {
61 *f = enumspb.CONTINUE_AS_NEW_INITIATOR_WORKFLOW
62 }
63 }
64
65 > func SetDefaultResetReapplyType(f *enumspb.ResetReapplyType) { workflow_handler.go ×6
66 > if *f == enumspb.RESET_REAPPLY_TYPE_UNSPECIFIED {
67 > *f = enumspb.RESET_REAPPLY_TYPE_ALL_ELIGIBLE
68 > }
69 }
70
71 > func SetDefaultUpdateWorkflowExecutionLifecycleStage(f *enumspb.UpdateWorkflowExecutionLifecycleStage) { workflow_handler.go ×9
72 > if *f == enumspb.UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_UNSPECIFIED {
73 > *f = enumspb.UPDATE_WORKFLOW_EXECUTION_LIFECYCLE_STAGE_COMPLETED
74 > }
75 }