Documentation
¶
Index ¶
- func ALBTargetGroupRequest(method, path string, opts HTTPEventOptions) events.ALBTargetGroupRequest
- func APIGatewayV2Request(method, path string, opts HTTPEventOptions) events.APIGatewayV2HTTPRequest
- func AppSyncEvent(opts AppSyncEventOptions) apptheory.AppSyncResolverEvent
- func CloudWatchLogsSubscriptionData(opts CloudWatchLogsSubscriptionOptions) []byte
- func DynamoDBStreamEvent(opts DynamoDBStreamEventOptions) events.DynamoDBEvent
- func EventBridgeEvent(opts EventBridgeEventOptions) events.EventBridgeEvent
- func KinesisEvent(opts KinesisEventOptions) events.KinesisEvent
- func LambdaFunctionURLRequest(method, path string, opts HTTPEventOptions) events.LambdaFunctionURLRequest
- func SNSEvent(opts SNSEventOptions) events.SNSEvent
- func SQSEvent(opts SQSEventOptions) events.SQSEvent
- func StepFunctionsTaskTokenEvent(opts StepFunctionsTaskTokenEventOptions) map[string]any
- func WebSocketEvent(opts WebSocketEventOptions) events.APIGatewayWebsocketProxyRequest
- type AppSyncEventOptions
- type CloudWatchLogsSubscriptionOptions
- type DynamoDBStreamEventOptions
- type DynamoDBStreamRecordOptions
- type Env
- func (e *Env) App(opts ...apptheory.Option) *apptheory.App
- func (e *Env) Invoke(ctx context.Context, app *apptheory.App, req apptheory.Request) apptheory.Response
- func (e *Env) InvokeALB(ctx context.Context, app *apptheory.App, event events.ALBTargetGroupRequest) events.ALBTargetGroupResponse
- func (e *Env) InvokeAPIGatewayV2(ctx context.Context, app *apptheory.App, event events.APIGatewayV2HTTPRequest) events.APIGatewayV2HTTPResponse
- func (e *Env) InvokeAppSync(ctx context.Context, app *apptheory.App, event apptheory.AppSyncResolverEvent) any
- func (e *Env) InvokeDynamoDBStream(ctx context.Context, app *apptheory.App, event events.DynamoDBEvent) events.DynamoDBEventResponse
- func (e *Env) InvokeEventBridge(ctx context.Context, app *apptheory.App, event events.EventBridgeEvent) (any, error)
- func (e *Env) InvokeKinesis(ctx context.Context, app *apptheory.App, event events.KinesisEvent) events.KinesisEventResponse
- func (e *Env) InvokeLambdaFunctionURL(ctx context.Context, app *apptheory.App, event events.LambdaFunctionURLRequest) events.LambdaFunctionURLResponse
- func (e *Env) InvokeSNS(ctx context.Context, app *apptheory.App, event events.SNSEvent) ([]any, error)
- func (e *Env) InvokeSQS(ctx context.Context, app *apptheory.App, event events.SQSEvent) events.SQSEventResponse
- func (e *Env) InvokeStreaming(ctx context.Context, app *apptheory.App, req apptheory.Request) StreamResult
- func (e *Env) InvokeWebSocket(ctx context.Context, app *apptheory.App, ...) events.APIGatewayProxyResponse
- type EventBridgeEventOptions
- type FakeSNSClient
- type FakeStreamerClient
- func (f *FakeStreamerClient) DeleteConnection(_ context.Context, connectionID string) error
- func (f *FakeStreamerClient) GetConnection(_ context.Context, connectionID string) (streamer.Connection, error)
- func (f *FakeStreamerClient) PostToConnection(_ context.Context, connectionID string, data []byte) error
- type HTTPEventOptions
- type KinesisCloudWatchLogsSubscriptionRecordOptions
- type KinesisEventOptions
- type KinesisRecordOptions
- type ManualClock
- type ManualIDGenerator
- type SNSEventOptions
- type SNSPublishCall
- type SNSRecordOptions
- type SQSEventOptions
- type SQSMessageOptions
- type StepFunctionsTaskTokenEventOptions
- type StreamResult
- type StreamerCall
- type WebSocketEventOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ALBTargetGroupRequest ¶
func ALBTargetGroupRequest(method, path string, opts HTTPEventOptions) events.ALBTargetGroupRequest
func APIGatewayV2Request ¶
func APIGatewayV2Request(method, path string, opts HTTPEventOptions) events.APIGatewayV2HTTPRequest
func AppSyncEvent ¶
func AppSyncEvent(opts AppSyncEventOptions) apptheory.AppSyncResolverEvent
func CloudWatchLogsSubscriptionData ¶
func CloudWatchLogsSubscriptionData(opts CloudWatchLogsSubscriptionOptions) []byte
func DynamoDBStreamEvent ¶
func DynamoDBStreamEvent(opts DynamoDBStreamEventOptions) events.DynamoDBEvent
func EventBridgeEvent ¶
func EventBridgeEvent(opts EventBridgeEventOptions) events.EventBridgeEvent
func KinesisEvent ¶
func KinesisEvent(opts KinesisEventOptions) events.KinesisEvent
func LambdaFunctionURLRequest ¶
func LambdaFunctionURLRequest(method, path string, opts HTTPEventOptions) events.LambdaFunctionURLRequest
func SNSEvent ¶
func SNSEvent(opts SNSEventOptions) events.SNSEvent
func SQSEvent ¶
func SQSEvent(opts SQSEventOptions) events.SQSEvent
func StepFunctionsTaskTokenEvent ¶
func StepFunctionsTaskTokenEvent(opts StepFunctionsTaskTokenEventOptions) map[string]any
func WebSocketEvent ¶
func WebSocketEvent(opts WebSocketEventOptions) events.APIGatewayWebsocketProxyRequest
Types ¶
type AppSyncEventOptions ¶
type DynamoDBStreamEventOptions ¶
type DynamoDBStreamEventOptions struct {
StreamARN string
Records []DynamoDBStreamRecordOptions
}
type Env ¶
type Env struct {
Clock *ManualClock
IDs *ManualIDGenerator
}
Env is a deterministic local test environment for AppTheory apps.
func NewWithTime ¶
func (*Env) InvokeALB ¶
func (e *Env) InvokeALB( ctx context.Context, app *apptheory.App, event events.ALBTargetGroupRequest, ) events.ALBTargetGroupResponse
func (*Env) InvokeAPIGatewayV2 ¶
func (e *Env) InvokeAPIGatewayV2( ctx context.Context, app *apptheory.App, event events.APIGatewayV2HTTPRequest, ) events.APIGatewayV2HTTPResponse
func (*Env) InvokeAppSync ¶
func (*Env) InvokeDynamoDBStream ¶
func (e *Env) InvokeDynamoDBStream( ctx context.Context, app *apptheory.App, event events.DynamoDBEvent, ) events.DynamoDBEventResponse
func (*Env) InvokeEventBridge ¶
func (*Env) InvokeKinesis ¶
func (e *Env) InvokeKinesis( ctx context.Context, app *apptheory.App, event events.KinesisEvent, ) events.KinesisEventResponse
func (*Env) InvokeLambdaFunctionURL ¶
func (e *Env) InvokeLambdaFunctionURL( ctx context.Context, app *apptheory.App, event events.LambdaFunctionURLRequest, ) events.LambdaFunctionURLResponse
func (*Env) InvokeStreaming ¶
func (e *Env) InvokeStreaming(ctx context.Context, app *apptheory.App, req apptheory.Request) StreamResult
InvokeStreaming executes an AppTheory request and captures streamed response chunks deterministically.
Headers and cookies are captured before reading the first chunk so tests can assert header finalization.
func (*Env) InvokeWebSocket ¶
func (e *Env) InvokeWebSocket( ctx context.Context, app *apptheory.App, event events.APIGatewayWebsocketProxyRequest, ) events.APIGatewayProxyResponse
type EventBridgeEventOptions ¶
type FakeSNSClient ¶
type FakeSNSClient struct {
Calls []SNSPublishCall
PublishErr error
// contains filtered or unexported fields
}
func NewFakeSNSClient ¶
func NewFakeSNSClient() *FakeSNSClient
func (*FakeSNSClient) Publish ¶
func (f *FakeSNSClient) Publish( _ context.Context, params *sns.PublishInput, _ ...func(*sns.Options), ) (*sns.PublishOutput, error)
type FakeStreamerClient ¶
type FakeStreamerClient struct {
Endpoint string
Calls []StreamerCall
Connections map[string]streamer.Connection
PostErr error
GetErr error
DeleteErr error
// contains filtered or unexported fields
}
func NewFakeStreamerClient ¶
func NewFakeStreamerClient(endpoint string) *FakeStreamerClient
func (*FakeStreamerClient) DeleteConnection ¶
func (f *FakeStreamerClient) DeleteConnection(_ context.Context, connectionID string) error
func (*FakeStreamerClient) GetConnection ¶
func (f *FakeStreamerClient) GetConnection(_ context.Context, connectionID string) (streamer.Connection, error)
func (*FakeStreamerClient) PostToConnection ¶
type HTTPEventOptions ¶
type HTTPEventOptions struct {
Query map[string][]string
Headers map[string]string
MultiHeaders map[string][]string
Cookies []string
Body []byte
IsBase64 bool
SourceIP string
}
HTTPEventOptions configures synthetic HTTP events for local testing.
type KinesisCloudWatchLogsSubscriptionRecordOptions ¶
type KinesisCloudWatchLogsSubscriptionRecordOptions struct {
EventID string
EventSourceARN string
PartitionKey string
Subscription CloudWatchLogsSubscriptionOptions
}
type KinesisEventOptions ¶
type KinesisEventOptions struct {
StreamARN string
Records []KinesisRecordOptions
}
type KinesisRecordOptions ¶
type KinesisRecordOptions struct {
EventID string
EventSourceARN string
PartitionKey string
Data []byte
}
func KinesisCloudWatchLogsSubscriptionRecord ¶
func KinesisCloudWatchLogsSubscriptionRecord(opts KinesisCloudWatchLogsSubscriptionRecordOptions) KinesisRecordOptions
type ManualClock ¶
type ManualClock struct {
// contains filtered or unexported fields
}
ManualClock is a deterministic, mutable clock for tests.
func NewManualClock ¶
func NewManualClock(now time.Time) *ManualClock
func (*ManualClock) Now ¶
func (c *ManualClock) Now() time.Time
func (*ManualClock) Set ¶
func (c *ManualClock) Set(now time.Time)
type ManualIDGenerator ¶
type ManualIDGenerator struct {
// contains filtered or unexported fields
}
ManualIDGenerator is a deterministic, predictable ID generator for tests.
func NewManualIDGenerator ¶
func NewManualIDGenerator() *ManualIDGenerator
func (*ManualIDGenerator) NewID ¶
func (g *ManualIDGenerator) NewID() string
func (*ManualIDGenerator) Queue ¶
func (g *ManualIDGenerator) Queue(ids ...string)
func (*ManualIDGenerator) Reset ¶
func (g *ManualIDGenerator) Reset()
type SNSEventOptions ¶
type SNSEventOptions struct {
TopicARN string
Records []SNSRecordOptions
}
type SNSPublishCall ¶
type SNSRecordOptions ¶
type SQSEventOptions ¶
type SQSEventOptions struct {
QueueARN string
Records []SQSMessageOptions
}
type SQSMessageOptions ¶
type StreamResult ¶
type StreamResult struct {
Status int
Headers map[string][]string
Cookies []string
Chunks [][]byte
Body []byte
IsBase64 bool
StreamErrorCode string
}
StreamResult captures a streamed AppTheory response deterministically for tests.
type StreamerCall ¶
type WebSocketEventOptions ¶
type WebSocketEventOptions struct {
RouteKey string
EventType string
ConnectionID string
DomainName string
Stage string
RequestID string
Body string
IsBase64 bool
Headers map[string]string
MultiValueHeaders map[string][]string
QueryStringParameters map[string]string
MultiValueQueryString map[string][]string
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mcp provides deterministic MCP client simulation and assertion helpers for testing MCP tool implementations without deploying infrastructure.
|
Package mcp provides deterministic MCP client simulation and assertion helpers for testing MCP tool implementations without deploying infrastructure. |
|
Package microvm provides deterministic test doubles for AppTheory MicroVM controllers.
|
Package microvm provides deterministic test doubles for AppTheory MicroVM controllers. |
|
Package oauth provides a small test harness for OAuth flows used by Claude Remote MCP connectors (DCR + PKCE + refresh).
|
Package oauth provides a small test harness for OAuth flows used by Claude Remote MCP connectors (DCR + PKCE + refresh). |
|
Package objectstore provides deterministic test doubles for AppTheory object-store code.
|
Package objectstore provides deterministic test doubles for AppTheory object-store code. |
Click to show internal directories.
Click to hide internal directories.