Documentation
¶
Index ¶
- func APIGatewayV2Request(method, path string, opts HTTPEventOptions) events.APIGatewayV2HTTPRequest
- func LambdaFunctionURLRequest(method, path string, opts HTTPEventOptions) events.LambdaFunctionURLRequest
- 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) InvokeAPIGatewayV2(ctx context.Context, app *apptheory.App, event events.APIGatewayV2HTTPRequest) events.APIGatewayV2HTTPResponse
- func (e *Env) InvokeLambdaFunctionURL(ctx context.Context, app *apptheory.App, event events.LambdaFunctionURLRequest) events.LambdaFunctionURLResponse
- type HTTPEventOptions
- type ManualClock
- type ManualIDGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIGatewayV2Request ¶
func APIGatewayV2Request(method, path string, opts HTTPEventOptions) events.APIGatewayV2HTTPRequest
func LambdaFunctionURLRequest ¶
func LambdaFunctionURLRequest(method, path string, opts HTTPEventOptions) events.LambdaFunctionURLRequest
Types ¶
type Env ¶
type Env struct {
Clock *ManualClock
IDs *ManualIDGenerator
}
Env is a deterministic local test environment for AppTheory apps.
func NewWithTime ¶
func (*Env) InvokeAPIGatewayV2 ¶
func (e *Env) InvokeAPIGatewayV2( ctx context.Context, app *apptheory.App, event events.APIGatewayV2HTTPRequest, ) events.APIGatewayV2HTTPResponse
func (*Env) InvokeLambdaFunctionURL ¶
func (e *Env) InvokeLambdaFunctionURL( ctx context.Context, app *apptheory.App, event events.LambdaFunctionURLRequest, ) events.LambdaFunctionURLResponse
type HTTPEventOptions ¶
type HTTPEventOptions struct {
Query map[string][]string
Headers map[string]string
Cookies []string
Body []byte
IsBase64 bool
}
HTTPEventOptions configures synthetic HTTP events for local testing.
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()
Click to show internal directories.
Click to hide internal directories.