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

54 LOC · 5 covered · 49 uncovered · 2 ranges · 18 concepts · 1 introducers · 8 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 filego.temporal.io/server/service/frontend/nexus_handler.go · 861 LOCfrontend/nexus_handler.g…nexus_handler.go ×3 · 15 introduced LOCnexus_handler.go ×3nexus_handler.go ×3 · 10 introduced LOCnexus_handler.go ×3nexus_handler.go ×4 · 10 introduced LOCnexus_handler.go ×4nexus_handler.go ×1 · 3 introduced LOCnexus_handler.go ×1nexus_handler.go ×1 · 3 introduced LOCnexus_handler.go ×1failure.go ×1 · 5 introduced LOCfailure.go ×1failure.go ×2 · 6 introduced LOCfailure.go ×2nexus_handler.go ×1 · 1 introduced LOCnexus_handler.go ×1nexus_handler.go ×1 · 1 introduced LOCnexus_handler.go ×1nexus_handler.go ×2 · 9 introduced LOCnexus_handler.go ×2nexus_handler.go ×2 · 10 introduced LOCnexus_handler.go ×2nexus_handler.go ×1 · 2 introduced LOCnexus_handler.go ×1nexus_handler.go ×2 · 11 introduced LOCnexus_handler.go ×2failure.go ×1 · 5 introduced LOCfailure.go ×1failure.go ×2 · 6 introduced LOCfailure.go ×2failure.go ×2 · 9 introduced LOCfailure.go ×2nexus_handler.go ×1 · 1 introduced LOCnexus_handler.go ×1util.go ×2 · 14 introduced LOCutil.go ×2TestNexusInterceptRequest_ForwardingDisabled_ResultsInUnavailable · introduced test · go.temporal.io/server/service/frontend/TestNexusInterceptRequest_ForwardingDisabled_ResultsInUnavailableTestNexusInterceptReques…TestNexusInterceptRequest_ForwardingEnabled_ResultsInNotActiveError · introduced test · go.temporal.io/server/service/frontend/TestNexusInterceptRequest_ForwardingEnabled_ResultsInNotActiveErrorTestNexusInterceptReques…TestNexusInterceptRequest_GlobalRateLimited_ResultsInResourceExhausted · introduced test · go.temporal.io/server/service/frontend/TestNexusInterceptRequest_GlobalRateLimited_ResultsInResourceExhaustedTestNexusInterceptReques…TestNexusInterceptRequest_HeadersSanitization · introduced test · go.temporal.io/server/service/frontend/TestNexusInterceptRequest_HeadersSanitizationTestNexusInterceptReques…TestNexusInterceptRequest_InvalidNamespaceState_ResultsInBadRequest · introduced test · go.temporal.io/server/service/frontend/TestNexusInterceptRequest_InvalidNamespaceState_ResultsInBadRequestTestNexusInterceptReques…TestNexusInterceptRequest_InvalidSDKVersion_ResultsInBadRequest · introduced test · go.temporal.io/server/service/frontend/TestNexusInterceptRequest_InvalidSDKVersion_ResultsInBadRequestTestNexusInterceptReques…TestNexusInterceptRequest_NamespaceConcurrencyLimited_ResultsInResourceExhausted · introduced test · go.temporal.io/server/service/frontend/TestNexusInterceptRequest_NamespaceConcurrencyLimited_ResultsInResourceExhaustedTestNexusInterceptReques…TestNexusInterceptRequest_NamespaceRateLimited_ResultsInResourceExhausted · introduced test · go.temporal.io/server/service/frontend/TestNexusInterceptRequest_NamespaceRateLimited_ResultsInResourceExhaustedTestNexusInterceptReques…Focused file · go.temporal.io/server/common/dynamicconfig/util.go · 54 LOCdynamicconfig/util.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 dynamicconfig
2
3 import (
4 "errors"
5 "regexp"
6 "time"
7
8 "github.com/mitchellh/mapstructure"
9 "go.temporal.io/server/common/util"
10 )
11
12 var (
13 MatchAnythingRE = regexp.MustCompile(".*")
14 MatchNothingRE = regexp.MustCompile(".^")
15 )
16
17 > func ConvertWildcardStringListToRegexp(in any) (*regexp.Regexp, error) { util.go ×2
18 > // first convert raw value to list of strings
19 > var patterns []string
20 > if err := mapstructure.Decode(in, &patterns); err != nil {
21 return nil, err
22 }
23 // then turn strings into regexp
24 > return util.WildCardStringsToRegexp(patterns) util.go ×2
25 }
26
27 func ConvertSimplePartitionScalerSettings(in any) (SimplePartitionScalerSettings, error) {
28 cfg, err := ConvertStructure(SimplePartitionScalerSettings{})(in)
29 if err != nil {
30 return SimplePartitionScalerSettings{}, err
31 }
32 validateThreshold := func(t SimplePartitionScalerThreshold) error {
33 if t.Window < 100*time.Millisecond {
34 return errors.New("threshold window too small")
35 } else if t.TargetRate < 1 {
36 return errors.New("target rate too small")
37 }
38 return nil
39 }
40 if cfg.Fixed < 0 || cfg.Min < 0 || cfg.Max < 0 {
41 return SimplePartitionScalerSettings{}, errors.New("negative value for Fixed/Min/Max")
42 }
43 for _, t := range cfg.Ups {
44 if err := validateThreshold(t); err != nil {
45 return SimplePartitionScalerSettings{}, err
46 }
47 }
48 for _, t := range cfg.Downs {
49 if err := validateThreshold(t); err != nil {
50 return SimplePartitionScalerSettings{}, err
51 }
52 }
53 return cfg, nil
54 }