nexustest

package
v1.25.0-rc.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocListenAddress

func AllocListenAddress(t *testing.T) string

func NewNexusServer

func NewNexusServer(t *testing.T, listenAddr string, handler nexus.Handler)

Types

type FakeEndpointRegistry added in v1.25.0

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 (FakeEndpointRegistry) GetByID added in v1.25.0

func (FakeEndpointRegistry) GetByName added in v1.25.0

func (f FakeEndpointRegistry) GetByName(ctx context.Context, namespaceID namespace.ID, endpointName string) (*persistencespb.NexusEndpointEntry, error)

func (FakeEndpointRegistry) StartLifecycle added in v1.25.0

func (f FakeEndpointRegistry) StartLifecycle()

func (FakeEndpointRegistry) StopLifecycle added in v1.25.0

func (f FakeEndpointRegistry) StopLifecycle()

type Handler

type Handler struct {
	nexus.UnimplementedHandler
	OnStartOperation  func(ctx context.Context, service, operation string, input *nexus.LazyValue, options nexus.StartOperationOptions) (nexus.HandlerStartOperationResult[any], error)
	OnCancelOperation func(ctx context.Context, service, operation, operationID string, options nexus.CancelOperationOptions) error
}

func (Handler) CancelOperation

func (h Handler) CancelOperation(ctx context.Context, service, operation, operationID string, options nexus.CancelOperationOptions) error

func (Handler) StartOperation

func (h Handler) StartOperation(ctx context.Context, service, operation string, input *nexus.LazyValue, options nexus.StartOperationOptions) (nexus.HandlerStartOperationResult[any], error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL