tests

package
v1.29.4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TotalCountMemoFieldName = "TotalCount"
	TotalSizeMemoFieldName  = "TotalSize"
)
View Source
const (
	TestKeywordSAFieldName  = searchattribute.TemporalScheduledById
	TestKeywordSAFieldValue = "test-keyword-value"
)

TODO: Register proper SA for TotalCount and TotalSize For now, CHASM framework does NOT support Per-Component SearchAttributes so just update a random existing pre-defined SA to make sure the logic works.

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)
	}),
)

Functions

This section is empty.

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 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 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
}

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) Describe

func (*PayloadStore) GetPayload

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

func (*PayloadStore) LifecycleState

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

func (*PayloadStore) RemovePayload

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

type PayloadTTLPureTaskExecutor

type PayloadTTLPureTaskExecutor struct{}

func (*PayloadTTLPureTaskExecutor) Execute

type PayloadTTLPureTaskValidator

type PayloadTTLPureTaskValidator struct{}

func (*PayloadTTLPureTaskValidator) Validate

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