Documentation ¶
Index ¶
- Constants
- Variables
- func APIFailureToNexusFailure(failure *failurepb.Failure) *nexus.Failure
- func IncomingServicePersistedEntryToExternalAPI(entry *persistencepb.NexusIncomingServiceEntry) *nexus.IncomingService
- func ProtoFailureToNexusFailure(failure *nexuspb.Failure) *nexus.Failure
- type IncomingServiceRegistry
- type IncomingServiceRegistryConfig
- type NamespaceAndTaskQueue
- type NamespaceService
- type OutgoingServiceRegistry
- func (h *OutgoingServiceRegistry) Create(ctx context.Context, req *operatorservice.CreateNexusOutgoingServiceRequest) (*operatorservice.CreateNexusOutgoingServiceResponse, error)
- func (h *OutgoingServiceRegistry) Delete(ctx context.Context, req *operatorservice.DeleteNexusOutgoingServiceRequest) (*operatorservice.DeleteNexusOutgoingServiceResponse, error)
- func (h *OutgoingServiceRegistry) Get(ctx context.Context, req *operatorservice.GetNexusOutgoingServiceRequest) (*operatorservice.GetNexusOutgoingServiceResponse, error)
- func (h *OutgoingServiceRegistry) List(ctx context.Context, req *operatorservice.ListNexusOutgoingServicesRequest) (*operatorservice.ListNexusOutgoingServicesResponse, error)
- func (h *OutgoingServiceRegistry) Update(ctx context.Context, req *operatorservice.UpdateNexusOutgoingServiceRequest) (*operatorservice.UpdateNexusOutgoingServiceResponse, error)
- type OutgoingServiceRegistryConfig
Constants ¶
const ( IssueNamespaceNotSet = "namespace is not set on request" IssueNameNotSet = "name is not set on request" IssueURLNotSet = "url is not set on request" )
Variables ¶
var PayloadSerializer nexus.Serializer = payloadSerializer{}
var RouteDispatchNexusTaskByNamespaceAndTaskQueue = routing.NewBuilder[NamespaceAndTaskQueue](). Constant("api", "v1", "namespaces"). StringVariable("namespace", func(params *NamespaceAndTaskQueue) *string { return ¶ms.Namespace }). Constant("task-queues"). StringVariable("task_queue", func(params *NamespaceAndTaskQueue) *string { return ¶ms.TaskQueue }). Constant("nexus-operations"). Build()
var RouteDispatchNexusTaskByService = routing.NewBuilder[string](). Constant("api", "v1", "nexus", "services"). StringVariable("service", func(service *string) *string { return service }). Constant("operations"). Build()
var ServiceNameRegex = regexp.MustCompile(`[a-zA-Z_][a-zA-Z0-9_]*`)
ServiceNameRegex is the regular expression that outgoing service names must match.
Functions ¶
func APIFailureToNexusFailure ¶
APIFailureToNexusFailure converts an API proto Failure to a Nexus SDK Failure taking only the failure message to avoid leaking too many details to 3rd party callers. Always returns a non-nil value.
func IncomingServicePersistedEntryToExternalAPI ¶
func IncomingServicePersistedEntryToExternalAPI(entry *persistencepb.NexusIncomingServiceEntry) *nexus.IncomingService
Types ¶
type IncomingServiceRegistry ¶
type IncomingServiceRegistry struct {
// contains filtered or unexported fields
}
IncomingServiceRegistry manages a cached view of Nexus incoming services. Services are lazily-loaded into memory on the first read. Thereafter, service data is kept up to date by background long polling on matching service ListNexusIncomingServices.
func NewIncomingServiceRegistry ¶
func NewIncomingServiceRegistry( config *IncomingServiceRegistryConfig, matchingClient matchingservice.MatchingServiceClient, persistence p.NexusIncomingServiceManager, logger log.Logger, ) *IncomingServiceRegistry
func (*IncomingServiceRegistry) Get ¶
func (r *IncomingServiceRegistry) Get(ctx context.Context, id string) (*nexus.IncomingService, error)
func (*IncomingServiceRegistry) StartLifecycle ¶
func (r *IncomingServiceRegistry) StartLifecycle()
StartLifecycle starts this component. It should only be invoked by an fx lifecycle hook. Should not be called multiple times or concurrently with StopLifecycle()
func (*IncomingServiceRegistry) StopLifecycle ¶
func (r *IncomingServiceRegistry) StopLifecycle()
StopLifecycle stops this component. It should only be invoked by an fx lifecycle hook. Should not be called multiple times or concurrently with StartLifecycle()
type IncomingServiceRegistryConfig ¶
type IncomingServiceRegistryConfig struct {
// contains filtered or unexported fields
}
func NewIncomingServiceRegistryConfig ¶
func NewIncomingServiceRegistryConfig(dc *dynamicconfig.Collection) *IncomingServiceRegistryConfig
type NamespaceAndTaskQueue ¶
type NamespaceService ¶
type NamespaceService interface { GetNamespace(ctx context.Context, request *persistence.GetNamespaceRequest) (*persistence.GetNamespaceResponse, error) UpdateNamespace(ctx context.Context, request *persistence.UpdateNamespaceRequest) error }
NamespaceService is an interface which contains only the methods we need from go.temporal.io/server/common/persistence.MetadataManager.
type OutgoingServiceRegistry ¶
type OutgoingServiceRegistry struct {
// contains filtered or unexported fields
}
OutgoingServiceRegistry manages the registration and retrieval of "outgoing" services from the namespace metadata in the persistence layer. An outgoing service is a Nexus service to which we send traffic. For example, we might call one of these services to start an operation using this API: https://github.com/nexus-rpc/api/blob/main/SPEC.md#start-operation. We need a registry for these services, so that we can look up the URL for a service by name. Later, we may add more service-specific information to the registry.
func NewOutgoingServiceRegistry ¶
func NewOutgoingServiceRegistry( namespaceService NamespaceService, namespaceReplicator namespace.Replicator, config *OutgoingServiceRegistryConfig, ) *OutgoingServiceRegistry
NewOutgoingServiceRegistry creates a new OutgoingServiceRegistry with the given namespace service and configuration.
func (*OutgoingServiceRegistry) Create ¶
func (h *OutgoingServiceRegistry) Create( ctx context.Context, req *operatorservice.CreateNexusOutgoingServiceRequest, ) (*operatorservice.CreateNexusOutgoingServiceResponse, error)
Create implements operatorservice.OperatorServiceServer.CreateNexusOutgoingService.
func (*OutgoingServiceRegistry) Delete ¶
func (h *OutgoingServiceRegistry) Delete( ctx context.Context, req *operatorservice.DeleteNexusOutgoingServiceRequest, ) (*operatorservice.DeleteNexusOutgoingServiceResponse, error)
Delete implements operatorservice.OperatorServiceServer.DeleteNexusOutgoingService.
func (*OutgoingServiceRegistry) Get ¶
func (h *OutgoingServiceRegistry) Get( ctx context.Context, req *operatorservice.GetNexusOutgoingServiceRequest, ) (*operatorservice.GetNexusOutgoingServiceResponse, error)
Get implements operatorservice.OperatorServiceServer.GetNexusOutgoingService.
func (*OutgoingServiceRegistry) List ¶
func (h *OutgoingServiceRegistry) List( ctx context.Context, req *operatorservice.ListNexusOutgoingServicesRequest, ) (*operatorservice.ListNexusOutgoingServicesResponse, error)
List implements operatorservice.OperatorServiceServer.ListNexusOutgoingServices.
func (*OutgoingServiceRegistry) Update ¶
func (h *OutgoingServiceRegistry) Update( ctx context.Context, req *operatorservice.UpdateNexusOutgoingServiceRequest, ) (*operatorservice.UpdateNexusOutgoingServiceResponse, error)
Update implements operatorservice.OperatorServiceServer.UpdateNexusOutgoingService.
type OutgoingServiceRegistryConfig ¶
type OutgoingServiceRegistryConfig struct { MaxURLLength dynamicconfig.IntPropertyFn MaxNameLength dynamicconfig.IntPropertyFn DefaultPageSize dynamicconfig.IntPropertyFn MaxPageSize dynamicconfig.IntPropertyFn }
OutgoingServiceRegistryConfig contains the dynamic configuration values for the OutgoingServiceRegistry.
func NewOutgoingServiceRegistryConfig ¶
func NewOutgoingServiceRegistryConfig(dc *dynamicconfig.Collection) *OutgoingServiceRegistryConfig
NewOutgoingServiceRegistryConfig creates a new OutgoingServiceRegistryConfig with the given dynamic configuration.