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

47 LOC · 26 covered · 21 uncovered · 6 ranges · 119 concepts · 5 introducers · 36 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 fileoperation.go ×2 · 6 introduced LOCoperation.go ×2sync_failed · 0 introduced LOCsync_failedtask_handler_helpers.go ×3 · 6 introduced LOCtask_handler_helpers.go …task_handler_helpers.go ×3 · 11 introduced LOCtask_handler_helpers.go …async_start · 0 introduced LOCasync_startinvocation.go ×2 · 10 introduced LOCinvocation.go ×2operation_tasks.go ×1 · 2 introduced LOCoperation_tasks.go ×1invocation_timeout_by_ScheduleToCloseTimeout · 0 introduced LOCinvocation_timeout_by_Sc…operation_tasks.go ×1 · 2 introduced LOCoperation_tasks.go ×1invocation.go ×1 · 7 introduced LOCinvocation.go ×1invocation.go ×2 · 2 introduced LOCinvocation.go ×2invocation_timeout_by_request_timeout · 0 introduced LOCinvocation_timeout_by_re…task_handler_helpers.go ×3 · 5 introduced LOCtask_handler_helpers.go …operation_tasks.go ×1 · 2 introduced LOCoperation_tasks.go ×1invocation.go ×3 · 10 introduced LOCinvocation.go ×3task_handler_helpers.go ×2 · 8 introduced LOCtask_handler_helpers.go …operation.go ×2 · 19 introduced LOCoperation.go ×2invocation.go ×1 · 4 introduced LOCinvocation.go ×1invocation.go ×1 · 6 introduced LOCinvocation.go ×1invocation.go ×1 · 3 introduced LOCinvocation.go ×1invocation.go ×3 · 7 introduced LOCinvocation.go ×3task_handler_helpers.go ×2 · 16 introduced LOCtask_handler_helpers.go …task_handler_helpers.go ×1 · 1 introduced LOCtask_handler_helpers.go …request_response.pb.go ×1 · 5 introduced LOCrequest_response.pb.go ×…task_handler_helpers.go ×7 · 15 introduced LOCtask_handler_helpers.go …invocation.go ×1 · 2 introduced LOCinvocation.go ×1task_handler_helpers.go ×1 · 1 introduced LOCtask_handler_helpers.go …operation.go ×2 · 4 introduced LOCoperation.go ×2operation.go ×1 · 5 introduced LOCoperation.go ×1invocation.go ×1 · 14 introduced LOCinvocation.go ×1operation.go ×2 · 8 introduced LOCoperation.go ×2task_handler_base.go ×3 · 14 introduced LOCtask_handler_base.go ×3operation_tasks.go ×2 · 8 introduced LOCoperation_tasks.go ×2task_handler_helpers.go ×1 · 1 introduced LOCtask_handler_helpers.go …operation_tasks.go ×2 · 13 introduced LOCoperation_tasks.go ×2task_handler_helpers.go ×1 · 1 introduced LOCtask_handler_helpers.go …task_handler_helpers.go ×1 · 1 introduced LOCtask_handler_helpers.go …operation_tasks.go ×1 · 2 introduced LOCoperation_tasks.go ×1task_handler_helpers.go ×1 · 1 introduced LOCtask_handler_helpers.go …task_handler_helpers.go ×1 · 1 introduced LOCtask_handler_helpers.go …executors.go ×1 · 4 introduced LOCexecutors.go ×1sync_failed · 0 introduced LOCsync_failedtask_handler_helpers.go ×1 · 1 introduced LOCtask_handler_helpers.go …operation_tasks.go ×1 · 2 introduced LOCoperation_tasks.go ×1invocation.go ×1 · 13 introduced LOCinvocation.go ×1task_handler_helpers.go ×1 · 1 introduced LOCtask_handler_helpers.go …task_handler_helpers.go ×2 · 4 introduced LOCtask_handler_helpers.go …operation_tasks.go ×1 · 2 introduced LOCoperation_tasks.go ×1operation_tasks.go ×2 · 5 introduced LOCoperation_tasks.go ×2operation_tasks.go ×1 · 2 introduced LOCoperation_tasks.go ×1operation_tasks.go ×15 · 92 introduced LOCoperation_tasks.go ×15executors.go ×4 · 9 introduced LOCexecutors.go ×4executors.go ×2 · 9 introduced LOCexecutors.go ×2operation.go ×2 · 4 introduced LOCoperation.go ×2statemachine.go ×3 · 6 introduced LOCstatemachine.go ×3async_start · 0 introduced LOCasync_startexecutors.go ×1 · 4 introduced LOCexecutors.go ×1operation_tasks.go ×2 · 5 introduced LOCoperation_tasks.go ×2task_handler_helpers.go ×4 · 6 introduced LOCtask_handler_helpers.go …operation.go ×1 · 2 introduced LOCoperation.go ×1executors.go ×1 · 2 introduced LOCexecutors.go ×1task_handler_helpers.go ×1 · 1 introduced LOCtask_handler_helpers.go …task_handler_helpers.go ×1 · 1 introduced LOCtask_handler_helpers.go …operation.go ×4 · 55 introduced LOCoperation.go ×4invocation_timeout_by_request_timeout, invocation_timeout_by_ScheduleToCloseTimeout · 0 introduced LOCinvocation_timeout_by_re…executors.go ×1 · 7 introduced LOCexecutors.go ×1executors.go ×2 · 2 introduced LOCexecutors.go ×2executors.go ×1 · 2 introduced LOCexecutors.go ×1executors.go ×2 · 5 introduced LOCexecutors.go ×2executors.go ×3 · 10 introduced LOCexecutors.go ×3executors.go ×1 · 2 introduced LOCexecutors.go ×1executors.go ×1 · 3 introduced LOCexecutors.go ×1executors.go ×1 · 7 introduced LOCexecutors.go ×1executors.go ×5 · 17 introduced LOCexecutors.go ×5executors.go ×5 · 16 introduced LOCexecutors.go ×5executors.go ×3 · 6 introduced LOCexecutors.go ×3executors.go ×3 · 9 introduced LOCexecutors.go ×3executors.go ×1 · 1 introduced LOCexecutors.go ×1executors.go ×3 · 6 introduced LOCexecutors.go ×3executors.go ×1 · 5 introduced LOCexecutors.go ×1executors.go ×1 · 3 introduced LOCexecutors.go ×1executors.go ×2 · 4 introduced LOCexecutors.go ×2executors.go ×1 · 3 introduced LOCexecutors.go ×1executors.go ×1 · 4 introduced LOCexecutors.go ×1executors.go ×6 · 35 introduced LOCexecutors.go ×6executors.go ×4 · 21 introduced LOCexecutors.go ×4executors.go ×2 · 4 introduced LOCexecutors.go ×2executors.go ×1 · 15 introduced LOCexecutors.go ×1executors.go ×1 · 1 introduced LOCexecutors.go ×1executors.go ×1 · 1 introduced LOCexecutors.go ×1executors.go ×3 · 13 introduced LOCexecutors.go ×3executors.go ×2 · 3 introduced LOCexecutors.go ×2executors.go ×4 · 16 introduced LOCexecutors.go ×4executors.go ×1 · 2 introduced LOCexecutors.go ×1executors.go ×1 · 4 introduced LOCexecutors.go ×1executors.go ×1 · 2 introduced LOCexecutors.go ×1executors.go ×1 · 1 introduced LOCexecutors.go ×1executors.go ×1 · 1 introduced LOCexecutors.go ×1executors.go ×2 · 3 introduced LOCexecutors.go ×2executors.go ×3 · 4 introduced LOCexecutors.go ×3executors.go ×2 · 5 introduced LOCexecutors.go ×2executors.go ×1 · 2 introduced LOCexecutors.go ×1executors.go ×1 · 2 introduced LOCexecutors.go ×1executors.go ×1 · 1 introduced LOCexecutors.go ×1executors.go ×18 · 70 introduced LOCexecutors.go ×18executors.go ×1 · 2 introduced LOCexecutors.go ×1executors.go ×1 · 2 introduced LOCexecutors.go ×1executors.go ×1 · 4 introduced LOCexecutors.go ×1executors.go ×2 · 9 introduced LOCexecutors.go ×2executors.go ×16 · 62 introduced LOCexecutors.go ×16server.go ×1 · 3 introduced LOCserver.go ×1client.go ×1 · 2 introduced LOCclient.go ×1util.go ×1 · 9 introduced LOCutil.go ×1util.go ×1 · 2 introduced LOCutil.go ×1util.go ×1 · 2 introduced LOCutil.go ×1request_response.pb.go ×1 · 4 introduced LOCrequest_response.pb.go ×…service_grpc.pb.mock.go ×3 · 13 introduced LOCservice_grpc.pb.mock.go …util.go ×2 · 10 introduced LOCutil.go ×2util.go ×1 · 3 introduced LOCutil.go ×1ScheduleToCloseTimeout_less_than_MinRequestTimeout · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/ScheduleToCloseTimeout_less_than_MinRequestTimeoutScheduleToCloseTimeout_l…async_start · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/async_startasync_startendpoint_not_found · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/endpoint_not_foundendpoint_not_foundinvocation_timeout_by_ScheduleToCloseTimeout · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/invocation_timeout_by_ScheduleToCloseTimeoutinvocation_timeout_by_Sc…invocation_timeout_by_ScheduleToStartTimeout · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/invocation_timeout_by_ScheduleToStartTimeoutinvocation_timeout_by_Sc…invocation_timeout_by_request_timeout · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/invocation_timeout_by_request_timeoutinvocation_timeout_by_re…operation_timeout_header_set_by_StartToCloseTimeout · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/operation_timeout_header_set_by_StartToCloseTimeoutoperation_timeout_header…sync_canceled · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/sync_canceledsync_canceledsync_failed · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/sync_failedsync_failedsync_start · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/sync_startsync_starttoken_too_long · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/token_too_longtoken_too_longtransient_error · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_HTTP/transient_errortransient_errorasync_start · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_SystemEndpoint/async_startasync_startchasm_processor_error · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_SystemEndpoint/chasm_processor_errorchasm_processor_errorhistory_service_error_-_retryable · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_SystemEndpoint/history_service_error_-_retryablehistory_service_error_-_…operation_error · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_SystemEndpoint/operation_erroroperation_errorsync_start · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestInvocationTaskHandler_SystemEndpoint/sync_startsync_startScheduleToCloseTimeout_less_than_MinRequestTimeout · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/ScheduleToCloseTimeout_less_than_MinRequestTimeoutScheduleToCloseTimeout_l…async_start · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/async_startasync_startcancel_before_start · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/cancel_before_startcancel_before_startendpoint_not_found · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/endpoint_not_foundendpoint_not_foundendpoint_not_found_on_command_processing · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/endpoint_not_found_on_command_processingendpoint_not_found_on_co…invocation_timeout_by_ScheduleToCloseTimeout · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/invocation_timeout_by_ScheduleToCloseTimeoutinvocation_timeout_by_Sc…invocation_timeout_by_ScheduleToStartTimeout · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/invocation_timeout_by_ScheduleToStartTimeoutinvocation_timeout_by_Sc…invocation_timeout_by_request_timeout · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/invocation_timeout_by_request_timeoutinvocation_timeout_by_re…operation_timeout_header_set_by_StartToCloseTimeout · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/operation_timeout_header_set_by_StartToCloseTimeoutoperation_timeout_header…sync_canceled · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/sync_canceledsync_canceledsync_failed · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/sync_failedsync_failedsync_start · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/sync_startsync_starttoken_to_long · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/token_to_longtoken_to_longtransient_error · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask/transient_errortransient_errorasync_start · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask_SystemEndpoint/async_startasync_startchasm_processor_error · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask_SystemEndpoint/chasm_processor_errorchasm_processor_errorhistory_service_error_-_retryable · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask_SystemEndpoint/history_service_error_-_retryablehistory_service_error_-_…operation_error · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask_SystemEndpoint/operation_erroroperation_errorsync_start · introduced test · go.temporal.io/server/components/nexusoperations/TestProcessInvocationTask_SystemEndpoint/sync_startsync_startFocused file · go.temporal.io/server/common/nexus/util.go · 47 LOCnexus/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 nexus
2
3 import (
4 "net/url"
5 "strconv"
6 "time"
7
8 "github.com/nexus-rpc/sdk-go/nexus"
9 nexuspb "go.temporal.io/api/nexus/v1"
10 )
11
12 // FormatDuration converts a duration into a string representation in millisecond resolution.
13 // TODO: replace this with the version exported from the Nexus SDK
14 > func FormatDuration(d time.Duration) string { util.go ×1
15 > return strconv.FormatInt(d.Milliseconds(), 10) + "ms"
16 > }
17
18 // ConvertLinksToProto converts Nexus SDK links to protobuf links.
19 > func ConvertLinksToProto(links []nexus.Link) []*nexuspb.Link { util.go ×2
20 > if links == nil {
21 return nil
22 }
23 > result := make([]*nexuspb.Link, len(links)) util.go ×2
24 > for i, link := range links {
25 > result[i] = &nexuspb.Link{
26 > Url: link.URL.String(),
27 > Type: link.Type,
28 > }
29 > }
30 > return result
31 }
32
33 // ConvertLinksFromProto converts protobuf links to Nexus SDK links.
34 > func ConvertLinksFromProto(links []*nexuspb.Link) []nexus.Link { util.go ×1
35 > if links == nil {
36 > return nil util.go ×1
37 > }
38 > result := make([]nexus.Link, len(links)) util.go ×1
39 > for i, link := range links {
40 > u, _ := url.Parse(link.Url)
41 > result[i] = nexus.Link{
42 > URL: u,
43 > Type: link.Type,
44 > }
45 > }
46 > return result
47 }