go.temporal.io/server/common/util/proto.go

65 LOC · 40 covered · 25 uncovered · 15 ranges · 65 concepts · 10 introducers · 53 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.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the fileTest_updateActivityOptionsAcceptance · 0 introduced LOCTest_updateActivityOptio…Test_updateActivityOptions_PerNSTQ_Allowed · 0 introduced LOCTest_updateActivityOptio…api.go ×4 · 44 introduced LOCapi.go ×4api.go ×2 · 4 introduced LOCapi.go ×2api.go ×2 · 17 introduced LOCapi.go ×2api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 1 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1api.go ×3 · 23 introduced LOCapi.go ×3api.go ×5 · 18 introduced LOCapi.go ×5api.go ×1 · 2 introduced LOCapi.go ×1api.go ×4 · 15 introduced LOCapi.go ×4api.go ×11 · 68 introduced LOCapi.go ×11activity.go ×12 · 72 introduced LOCactivity.go ×12TestApplyActivityOptionsReset · 0 introduced LOCTestApplyActivityOptions…TestNewStandaloneActivity_OriginalOptionsUnaffectedBySubfieldUpdate · 0 introduced LOCTestNewStandaloneActivit…reapply:_TSC_updated_with_same_fast-forward · 0 introduced LOCreapply:_TSC_updated_wit…nil_allowed:_nil_with_mask_clears_the_TSC · 0 introduced LOCnil_allowed:_nil_with_ma…TSC_no_change:_version_update_with_fast-forward_untouched · 0 introduced LOCTSC_no_change:_version_u…basic:_disable_from_enabled_config · 0 introduced LOCbasic:_disable_from_enab…basic:_fast-forward_from_nil · 0 introduced LOCbasic:_fast-forward_from…basic:_enable_from_nil_config · 0 introduced LOCbasic:_enable_from_nil_c…api.go ×1 · 2 introduced LOCapi.go ×1api.go ×2 · 7 introduced LOCapi.go ×2api.go ×1 · 3 introduced LOCapi.go ×1api.go ×6 · 20 introduced LOCapi.go ×6api.go ×3 · 11 introduced LOCapi.go ×3same_config_with_side-effect_field_change · 0 introduced LOCsame_config_with_side-ef…TestMergeOptions_VersionOverrideMask · 0 introduced LOCTestMergeOptions_Version…api.go ×1 · 2 introduced LOCapi.go ×1nil_update_-_clears_the_TSC, new_config_to_disable_time_skipping, +1 · 0 introduced LOCnil_update_-_clears_the_…api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 2 introduced LOCapi.go ×1api.go ×1 · 3 introduced LOCapi.go ×1api.go ×1 · 1 introduced LOCapi.go ×1api.go ×1 · 3 introduced LOCapi.go ×1api.go ×1 · 3 introduced LOCapi.go ×1activity.go ×2 · 11 introduced LOCactivity.go ×2api.go ×1 · 3 introduced LOCapi.go ×1api.go ×8 · 12 introduced LOCapi.go ×8activity.go ×1 · 2 introduced LOCactivity.go ×1api.go ×4 · 6 introduced LOCapi.go ×4activity.go ×1 · 1 introduced LOCactivity.go ×1activity.go ×2 · 17 introduced LOCactivity.go ×2merge.go ×1 · 2 introduced LOCmerge.go ×1worker_override_is_preserved_regardless_of_value, retry_policy_subfield_update_with_policy-derived_interval, +1 · 0 introduced LOCworker_override_is_prese…activity.go ×1 · 2 introduced LOCactivity.go ×1retry_policy_replacement_with_policy-derived_interval · 0 introduced LOCretry_policy_replacement…activity.go ×1 · 1 introduced LOCactivity.go ×1Sub-fields · 0 introduced LOCSub-fieldsmerge.go ×9 · 18 introduced LOCmerge.go ×9Top-level_fields_with_snake_case · 0 introduced LOCTop-level_fields_with_sn…Top-level_fields_with_CamelCase · 0 introduced LOCTop-level_fields_with_Ca…proto.go ×1 · 4 introduced LOCproto.go ×1TestFieldMaskHasPathOrSubPath · 0 introduced LOCTestFieldMaskHasPathOrSu…proto.go ×1 · 1 introduced LOCproto.go ×1proto.go ×5 · 18 introduced LOCproto.go ×5TestFieldMaskHasSubPath · 0 introduced LOCTestFieldMaskHasSubPathproto.go ×1 · 1 introduced LOCproto.go ×1proto.go ×1 · 2 introduced LOCproto.go ×1proto.go ×1 · 1 introduced LOCproto.go ×1proto.go ×1 · 2 introduced LOCproto.go ×1proto.go ×2 · 5 introduced LOCproto.go ×2proto.go ×1 · 2 introduced LOCproto.go ×1proto.go ×1 · 4 introduced LOCproto.go ×1TestMergeActivityOptionsRejectsInvalidMergedRetryPolicy · introduced test · go.temporal.io/server/chasm/lib/activity/TestMergeActivityOptionsRejectsInvalidMergedRetryPolicyTestMergeActivityOptions…TestNewStandaloneActivity_OriginalOptionsUnaffectedBySubfieldUpdate · introduced test · go.temporal.io/server/chasm/lib/activity/TestNewStandaloneActivity_OriginalOptionsUnaffectedBySubfieldUpdateTestNewStandaloneActivit…retry_policy_replacement_with_policy-derived_interval · introduced test · go.temporal.io/server/chasm/lib/activity/TestShouldRecalculateCurrentRetryInterval/retry_policy_replacement_with_policy-derived_intervalretry_policy_replacement…retry_policy_subfield_update_with_policy-derived_interval · introduced test · go.temporal.io/server/chasm/lib/activity/TestShouldRecalculateCurrentRetryInterval/retry_policy_subfield_update_with_policy-derived_intervalretry_policy_subfield_up…unrelated_update_preserves_retry_interval · introduced test · go.temporal.io/server/chasm/lib/activity/TestShouldRecalculateCurrentRetryInterval/unrelated_update_preserves_retry_intervalunrelated_update_preserv…unspecified_source_(pre-existing_attempt_state)_is_preserved · introduced test · go.temporal.io/server/chasm/lib/activity/TestShouldRecalculateCurrentRetryInterval/unspecified_source_(pre-existing_attempt_state)_is_preservedunspecified_source_(pre-…worker_override_is_preserved_regardless_of_value · introduced test · go.temporal.io/server/chasm/lib/activity/TestShouldRecalculateCurrentRetryInterval/worker_override_is_preserved_regardless_of_valueworker_override_is_prese…TestUpdateStartedActivityExecutionOptionsDoesNotBumpStartedStamp · introduced test · go.temporal.io/server/chasm/lib/activity/TestUpdateStartedActivityExecutionOptionsDoesNotBumpStartedStampTestUpdateStartedActivit…Sub-fields · introduced test · go.temporal.io/server/common/activityoptions/TestMergeActivityOptionsAcceptance/Sub-fieldsSub-fieldsTop-level_fields_with_CamelCase · introduced test · go.temporal.io/server/common/activityoptions/TestMergeActivityOptionsAcceptance/Top-level_fields_with_CamelCaseTop-level_fields_with_Ca…Top-level_fields_with_snake_case · introduced test · go.temporal.io/server/common/activityoptions/TestMergeActivityOptionsAcceptance/Top-level_fields_with_snake_caseTop-level_fields_with_sn…TestMergeActivityOptionsErrors · introduced test · go.temporal.io/server/common/activityoptions/TestMergeActivityOptionsErrorsTestMergeActivityOptions…Already.CamelCase · introduced test · go.temporal.io/server/common/util/TestConvertPathToCamel/Already.CamelCaseAlready.CamelCaseCamelCase · introduced test · go.temporal.io/server/common/util/TestConvertPathToCamel/CamelCaseCamelCaseDot.Separated · introduced test · go.temporal.io/server/common/util/TestConvertPathToCamel/Dot.SeparatedDot.SeparatedMix.of.Snake_case.and.CamelCase · introduced test · go.temporal.io/server/common/util/TestConvertPathToCamel/Mix.of.Snake_case.and.CamelCaseMix.of.Snake_case.and.Ca…UPPERCASE · introduced test · go.temporal.io/server/common/util/TestConvertPathToCamel/UPPERCASEUPPERCASEdash_separated · introduced test · go.temporal.io/server/common/util/TestConvertPathToCamel/dash_separateddash_separateddash_separated.and_another · introduced test · go.temporal.io/server/common/util/TestConvertPathToCamel/dash_separated.and_anotherdash_separated.and_anoth…underscore · introduced test · go.temporal.io/server/common/util/TestConvertPathToCamel/underscoreunderscoreTestFieldMaskHasPathOrSubPath · introduced test · go.temporal.io/server/common/util/TestFieldMaskHasPathOrSubPathTestFieldMaskHasPathOrSu…TestFieldMaskHasSubPath · introduced test · go.temporal.io/server/common/util/TestFieldMaskHasSubPathTestFieldMaskHasSubPathTest_updateActivityOptionsAcceptance · introduced test · go.temporal.io/server/service/history/api/updateactivityoptions/TestActivityOptionsSuite/Test_updateActivityOptionsAcceptanceTest_updateActivityOptio…Test_updateActivityOptionsRejectsInvalidMergedRetryPolicy · introduced test · go.temporal.io/server/service/history/api/updateactivityoptions/TestActivityOptionsSuite/Test_updateActivityOptionsRejectsInvalidMergedRetryPolicyTest_updateActivityOptio…Test_updateActivityOptionsWfNoActivity · introduced test · go.temporal.io/server/service/history/api/updateactivityoptions/TestActivityOptionsSuite/Test_updateActivityOptionsWfNoActivityTest_updateActivityOptio…Test_updateActivityOptions_PerNSTQ_Allowed · introduced test · go.temporal.io/server/service/history/api/updateactivityoptions/TestActivityOptionsSuite/Test_updateActivityOptions_PerNSTQ_AllowedTest_updateActivityOptio…Test_updateActivityOptions_PerNSTQ_Blocked · introduced test · go.temporal.io/server/service/history/api/updateactivityoptions/TestActivityOptionsSuite/Test_updateActivityOptions_PerNSTQ_BlockedTest_updateActivityOptio…Test_updateActivityOptions_RestoreDefaultFail · introduced test · go.temporal.io/server/service/history/api/updateactivityoptions/TestActivityOptionsSuite/Test_updateActivityOptions_RestoreDefaultFailTest_updateActivityOptio…TestApplyActivityOptionsReset · introduced test · go.temporal.io/server/service/history/api/updateactivityoptions/TestApplyActivityOptionsResetTestApplyActivityOptions…TSC_no_change:_TSC_without_fast-forward_are_updated_with_same_value · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeAndApply/TSC_no_change:_TSC_without_fast-forward_are_updated_with_same_valueTSC_no_change:_TSC_witho…TSC_no_change:_version_update_with_fast-forward_untouched · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeAndApply/TSC_no_change:_version_update_with_fast-forward_untouchedTSC_no_change:_version_u…basic:_disable_from_enabled_config · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeAndApply/basic:_disable_from_enabled_configbasic:_disable_from_enab…basic:_enable_from_nil_config · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeAndApply/basic:_enable_from_nil_configbasic:_enable_from_nil_c…basic:_fast-forward_from_nil · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeAndApply/basic:_fast-forward_from_nilbasic:_fast-forward_from…nil_allowed:_nil_with_mask_clears_the_TSC · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeAndApply/nil_allowed:_nil_with_mask_clears_the_TSCnil_allowed:_nil_with_ma…reapply:_TSC_updated_with_same_fast-forward · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeAndApply/reapply:_TSC_updated_with_same_fast-forwardreapply:_TSC_updated_wit…TestMergeOptions_EmptyMask · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_EmptyMaskTestMergeOptions_EmptyMa…TestMergeOptions_PartialMask · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_PartialMaskTestMergeOptions_Partial…new_config_to_disable_time_skipping · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_TimeSkippingConfig/new_config_to_disable_time_skippingnew_config_to_disable_ti…new_config_to_enable_time_skipping · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_TimeSkippingConfig/new_config_to_enable_time_skippingnew_config_to_enable_tim…new_config_with_side-effect_field_change · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_TimeSkippingConfig/new_config_with_side-effect_field_changenew_config_with_side-eff…nil_update_-_clears_the_TSC · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_TimeSkippingConfig/nil_update_-_clears_the_TSCnil_update_-_clears_the_…same_config_with_no_side-effect_field_change · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_TimeSkippingConfig/same_config_with_no_side-effect_field_changesame_config_with_no_side…same_config_with_side-effect_field_change · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_TimeSkippingConfig/same_config_with_side-effect_field_changesame_config_with_side-ef…TestMergeOptions_VersionOverrideMask · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_VersionOverrideMaskTestMergeOptions_Version…auto_upgrade_oneof_field · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_VersionOverrideNestedMask/auto_upgrade_oneof_fieldauto_upgrade_oneof_fieldone_time_field · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_VersionOverrideNestedMask/one_time_fieldone_time_fieldone_time_target_version_build_id_field · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_VersionOverrideNestedMask/one_time_target_version_build_id_fieldone_time_target_version_…one_time_target_version_deployment_name_field · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_VersionOverrideNestedMask/one_time_target_version_deployment_name_fieldone_time_target_version_…one_time_target_version_field · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_VersionOverrideNestedMask/one_time_target_version_fieldone_time_target_version_…pinned_nested_version_field · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_VersionOverrideNestedMask/pinned_nested_version_fieldpinned_nested_version_fi…pinned_oneof_field · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestMergeOptions_VersionOverrideNestedMask/pinned_oneof_fieldpinned_oneof_fieldTestInvoke_Success · introduced test · go.temporal.io/server/service/history/api/updateworkflowoptions/TestUpdateWorkflowOptionsSuite/TestInvoke_SuccessTestInvoke_SuccessFocused file · go.temporal.io/server/common/util/proto.go · 65 LOCutil/proto.go

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 util
2
3 import (
4 "strings"
5
6 "golang.org/x/text/cases"
7 "golang.org/x/text/language"
8 "google.golang.org/protobuf/types/known/fieldmaskpb"
9 )
10
11 > func ConvertPathToCamel(input string) []string { proto.go ×5
12 > var pathParts []string
13 > for path := range strings.SplitSeq(input, ".") {
14 > // Split by "_" and convert each word to Title Case (CamelCase)
15 > var b strings.Builder
16 > j := 0
17 > for word := range strings.SplitSeq(path, "_") {
18 > if j > 0 {
19 > b.WriteString(cases.Title(language.Und).String(strings.ToLower(word))) proto.go ×1
20 > } else { proto.go ×5
21 > // lowercase the first letter
22 > if len(word) > 0 {
23 > b.WriteString(strings.ToLower(word[:1]))
24 > if len(word) > 1 {
25 > b.WriteString(word[1:])
26 > }
27 }
28 }
29 > j++ proto.go ×5
30 }
31 // Join the words into a CamelCase substring
32 > pathParts = append(pathParts, b.String()) proto.go ×5
33 }
34 // Join all CamelCase substrings back with "."
35 > return pathParts proto.go ×5
36 }
37
38 > func ParseFieldMask(mask *fieldmaskpb.FieldMask) map[string]struct{} { proto.go ×2
39 > fieldMaskPaths := make(map[string]struct{})
40 >
41 > for _, path := range mask.Paths {
42 > pathParts := ConvertPathToCamel(path) proto.go ×1
43 > jsonPath := strings.Join(pathParts, ".")
44 > fieldMaskPaths[jsonPath] = struct{}{}
45 > }
46
47 > return fieldMaskPaths proto.go ×2
48 }
49
50 > func FieldMaskHasSubPath(fieldMaskPaths map[string]struct{}, path string) bool { proto.go ×1
51 > prefix := strings.TrimSuffix(path, ".") + "."
52 > for field := range fieldMaskPaths {
53 > if strings.HasPrefix(field, prefix) {
54 > return true proto.go ×1
55 > }
56 }
57 > return false proto.go ×1
58 }
59
60 > func FieldMaskHasPathOrSubPath(fieldMaskPaths map[string]struct{}, path string) bool { proto.go ×1
61 > if _, ok := fieldMaskPaths[path]; ok {
62 > return true proto.go ×1
63 > }
64 > return FieldMaskHasSubPath(fieldMaskPaths, path) proto.go ×1
65 }