tests

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TotalCountMemoFieldName = "TotalCount"
	TotalSizeMemoFieldName  = "TotalSize"
)
View Source
const (
	TestScheduleID               = "TestScheduleID"
	PayloadTotalCountSAAlias     = "PayloadTotalCount"
	PayloadTotalSizeSAAlias      = "PayloadTotalSize"
	ExecutionStatusSAAlias       = "ExecutionStatus"
	DefaultPayloadStoreTaskQueue = "payload-store-task-queue"
)

Variables

View Source
var Library = &library{}
View Source
var Module = fx.Module(
	"chasm.lib.tests",
	fx.Invoke(func(registry *chasm.Registry) error {
		return registry.Register(Library)
	}),
)
View Source
var TestOperation = nexus.NewSyncOperation("TestOperation", func(ctx context.Context, input string, options nexus.StartOperationOptions) (string, error) {
	return "Hello, " + input, nil
})

Functions

func DeletePayloadStoreHandler

func DeletePayloadStoreHandler(
	ctx context.Context,
	request DeletePayloadStoreRequest,
) error

func NewTestServiceNexusService

func NewTestServiceNexusService() *nexus.Service

func NewTestServiceNexusServiceProcessor

func NewTestServiceNexusServiceProcessor() *chasm.NexusServiceProcessor

Types

type AddPayloadRequest

type AddPayloadRequest struct {
	NamespaceID namespace.ID
	StoreID     string
	PayloadKey  string
	Payload     *commonpb.Payload
	TTL         time.Duration
}

type AddPayloadResponse

type AddPayloadResponse struct {
	State *testspb.TestPayloadStore
}

func AddPayloadHandler

func AddPayloadHandler(
	ctx context.Context,
	request AddPayloadRequest,
) (AddPayloadResponse, error)

type CancelPayloadStoreRequest

type CancelPayloadStoreRequest struct {
	NamespaceID namespace.ID
	StoreID     string
}

type CancelPayloadStoreResponse

type CancelPayloadStoreResponse struct{}

type ClosePayloadStoreRequest

type ClosePayloadStoreRequest struct {
	NamespaceID namespace.ID
	StoreID     string
}

type ClosePayloadStoreResponse

type ClosePayloadStoreResponse struct{}

func ClosePayloadStoreHandler

func ClosePayloadStoreHandler(
	ctx context.Context,
	request ClosePayloadStoreRequest,
) (ClosePayloadStoreResponse, error)

type DeletePayloadStoreRequest

type DeletePayloadStoreRequest struct {
	NamespaceID namespace.ID
	StoreID     string
	Reason      string
	Identity    string
}

type DescribePayloadStoreRequest

type DescribePayloadStoreRequest struct {
	NamespaceID namespace.ID
	StoreID     string
}

type DescribePayloadStoreResponse

type DescribePayloadStoreResponse struct {
	State *testspb.TestPayloadStore
}

type GetPayloadRequest

type GetPayloadRequest struct {
	NamespaceID namespace.ID
	StoreID     string
	PayloadKey  string
}

type GetPayloadResponse

type GetPayloadResponse struct {
	Payload *commonpb.Payload
}

func GetPayloadHandler

func GetPayloadHandler(
	ctx context.Context,
	request GetPayloadRequest,
) (GetPayloadResponse, error)

type NewPayloadStoreRequest

type NewPayloadStoreRequest struct {
	NamespaceID      namespace.ID
	StoreID          string
	IDReusePolicy    chasm.BusinessIDReusePolicy
	IDConflictPolicy chasm.BusinessIDConflictPolicy
}

type NewPayloadStoreResponse

type NewPayloadStoreResponse struct {
	RunID string
}

func NewPayloadStoreHandler

func NewPayloadStoreHandler(
	ctx context.Context,
	request NewPayloadStoreRequest,
) (NewPayloadStoreResponse, error)

type PayloadStore

type PayloadStore struct {
	chasm.UnimplementedComponent

	State *testspb.TestPayloadStore

	Payloads   chasm.Map[string, *commonpb.Payload]
	Visibility chasm.Field[*chasm.Visibility]
}

func NewPayloadStore

func NewPayloadStore(
	mutableContext chasm.MutableContext,
) (*PayloadStore, error)

func (*PayloadStore) AddPayload

func (s *PayloadStore) AddPayload(
	mutableContext chasm.MutableContext,
	request AddPayloadRequest,
) (*testspb.TestPayloadStore, error)

func (*PayloadStore) Close

func (*PayloadStore) Describe

func (*PayloadStore) GetPayload

func (s *PayloadStore) GetPayload(
	chasmContext chasm.Context,
	key string,
) (*commonpb.Payload, error)

func (*PayloadStore) LifecycleState

func (s *PayloadStore) LifecycleState(
	chasmContext chasm.Context,
) chasm.LifecycleState

func (*PayloadStore) Memo

func (s *PayloadStore) Memo(chasmContext chasm.Context) proto.Message

Memo implements chasm.VisibilityMemoProvider interface

func (*PayloadStore) RemovePayload

func (s *PayloadStore) RemovePayload(
	mutableContext chasm.MutableContext,
	key string,
) (*testspb.TestPayloadStore, error)

func (*PayloadStore) SearchAttributes

func (s *PayloadStore) SearchAttributes(
	chasmContext chasm.Context,
) []chasm.SearchAttributeKeyValue

SearchAttributes implements chasm.VisibilitySearchAttributesProvider interface

func (*PayloadStore) Terminate

type PayloadTTLPureTaskExecutor

type PayloadTTLPureTaskExecutor struct{}

func (*PayloadTTLPureTaskExecutor) Execute

type PayloadTTLPureTaskValidator

type PayloadTTLPureTaskValidator struct{}

func (*PayloadTTLPureTaskValidator) Validate

func (v *PayloadTTLPureTaskValidator) Validate(
	chasmContext chasm.Context,
	store *PayloadStore,
	attributes chasm.TaskAttributes,
	task *testspb.TestPayloadTTLPureTask,
) (bool, error)

type PayloadTTLSideEffectTaskExecutor

type PayloadTTLSideEffectTaskExecutor struct{}

func (*PayloadTTLSideEffectTaskExecutor) Execute

type PayloadTTLSideEffectTaskValidator

type PayloadTTLSideEffectTaskValidator struct{}

func (*PayloadTTLSideEffectTaskValidator) Validate

type RemovePayloadRequest

type RemovePayloadRequest struct {
	NamespaceID namespace.ID
	StoreID     string
	PayloadKey  string
}

type RemovePayloadResponse

type RemovePayloadResponse struct {
	State *testspb.TestPayloadStore
}

func RemovePayloadHandler

func RemovePayloadHandler(
	ctx context.Context,
	request RemovePayloadRequest,
) (RemovePayloadResponse, error)

Directories

Path Synopsis
gen
testspb/v1
Code generated by protoc-gen-go-helpers.
Code generated by protoc-gen-go-helpers.

Jump to

Keyboard shortcuts

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