mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-02 12:22:18 +00:00
## What? - [Merge EndpointChecker into EndpointRegistry](https://github.com/temporalio/temporal/pull/6118/commits/ab72c6938df5ee8625605e9eaedb1d15225a758f) - [Use endpoint ID as the nexus task destinations](https://github.com/temporalio/temporal/pull/6118/commits/b62db6dc3af0041a2891ab0a62b3bb132b5b4e46) - [Allow injecting only the HTTPCallerProvider for callbacks](https://github.com/temporalio/temporal/pull/6118/commits/973b338418c14976cde7c3f1f14605e92e929f27) ## Why? - The interface was redundant - Allow alternative registry implementations to have per namespace endpoints - Reduce the impact of renaming an endpoint - Make it easier to inject the caller provider
55 lines
2.2 KiB
Go
55 lines
2.2 KiB
Go
// The MIT License
|
|
//
|
|
// Copyright (c) 2024 Temporal Technologies Inc. All rights reserved.
|
|
//
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
// in the Software without restriction, including without limitation the rights
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
// furnished to do so, subject to the following conditions:
|
|
//
|
|
// The above copyright notice and this permission notice shall be included in
|
|
// all copies or substantial portions of the Software.
|
|
//
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
// THE SOFTWARE.
|
|
|
|
package nexustest
|
|
|
|
import (
|
|
"context"
|
|
|
|
persistencespb "go.temporal.io/server/api/persistence/v1"
|
|
"go.temporal.io/server/common/namespace"
|
|
commonnexus "go.temporal.io/server/common/nexus"
|
|
)
|
|
|
|
type FakeEndpointRegistry struct {
|
|
OnGetByID func(ctx context.Context, endpointID string) (*persistencespb.NexusEndpointEntry, error)
|
|
OnGetByName func(ctx context.Context, namespaceID namespace.ID, endpointName string) (*persistencespb.NexusEndpointEntry, error)
|
|
}
|
|
|
|
func (f FakeEndpointRegistry) GetByID(ctx context.Context, endpointID string) (*persistencespb.NexusEndpointEntry, error) {
|
|
return f.OnGetByID(ctx, endpointID)
|
|
}
|
|
|
|
func (f FakeEndpointRegistry) GetByName(ctx context.Context, namespaceID namespace.ID, endpointName string) (*persistencespb.NexusEndpointEntry, error) {
|
|
return f.OnGetByName(ctx, namespaceID, endpointName)
|
|
}
|
|
|
|
func (f FakeEndpointRegistry) StartLifecycle() {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
func (f FakeEndpointRegistry) StopLifecycle() {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
var _ commonnexus.EndpointRegistry = FakeEndpointRegistry{}
|