Documentation
¶
Index ¶
- type App
- func (a *App) Delete(pattern string, handler Handler, opts ...RouteOption) *App
- func (a *App) Get(pattern string, handler Handler, opts ...RouteOption) *App
- func (a *App) Handle(method, pattern string, handler Handler, opts ...RouteOption) *App
- func (a *App) Post(pattern string, handler Handler, opts ...RouteOption) *App
- func (a *App) Put(pattern string, handler Handler, opts ...RouteOption) *App
- func (a *App) Serve(ctx context.Context, req Request) (resp Response)
- func (a *App) ServeAPIGatewayV2(ctx context.Context, event events.APIGatewayV2HTTPRequest) events.APIGatewayV2HTTPResponse
- func (a *App) ServeLambdaFunctionURL(ctx context.Context, event events.LambdaFunctionURLRequest) events.LambdaFunctionURLResponse
- type AppError
- type AuthHook
- type Clock
- type Context
- type Handler
- type IDGenerator
- type Limits
- type LogRecord
- type MetricRecord
- type ObservabilityHooks
- type Option
- type PolicyDecision
- type PolicyHook
- type RandomIDGenerator
- type RealClock
- type Request
- type Response
- type RouteOption
- type SpanRecord
- type Tier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the root container for an AppTheory application.
AppTheory's runtime behavior is defined by a fixture-backed, versioned contract: `docs/development/planning/apptheory/supporting/apptheory-runtime-contract-v0.md`.
func (*App) Delete ¶
func (a *App) Delete(pattern string, handler Handler, opts ...RouteOption) *App
func (*App) Handle ¶
func (a *App) Handle(method, pattern string, handler Handler, opts ...RouteOption) *App
func (*App) ServeAPIGatewayV2 ¶
func (a *App) ServeAPIGatewayV2(ctx context.Context, event events.APIGatewayV2HTTPRequest) events.APIGatewayV2HTTPResponse
func (*App) ServeLambdaFunctionURL ¶
func (a *App) ServeLambdaFunctionURL(ctx context.Context, event events.LambdaFunctionURLRequest) events.LambdaFunctionURLResponse
type Context ¶
type Context struct {
Request Request
Params map[string]string
RequestID string
TenantID string
AuthIdentity string
RemainingMS int
MiddlewareTrace []string
// contains filtered or unexported fields
}
Context is the per-request context passed to handlers.
type IDGenerator ¶
type IDGenerator interface {
NewID() string
}
IDGenerator provides randomness for IDs/correlation IDs.
type ObservabilityHooks ¶
type ObservabilityHooks struct {
Log func(LogRecord)
Metric func(MetricRecord)
Span func(SpanRecord)
}
type Option ¶
type Option func(*App)
func WithAuthHook ¶
func WithIDGenerator ¶
func WithIDGenerator(ids IDGenerator) Option
func WithLimits ¶
func WithObservability ¶
func WithObservability(hooks ObservabilityHooks) Option
func WithPolicyHook ¶
func WithPolicyHook(hook PolicyHook) Option
type PolicyDecision ¶
type PolicyHook ¶
type PolicyHook func(*Context) (*PolicyDecision, error)
type RandomIDGenerator ¶
type RandomIDGenerator struct{}
RandomIDGenerator generates IDs using cryptographic randomness.
func (RandomIDGenerator) NewID ¶
func (RandomIDGenerator) NewID() string
type Request ¶
type Request struct {
Method string
Path string
Query map[string][]string
Headers map[string][]string
Cookies map[string]string
Body []byte
IsBase64 bool
}
Request is the canonical HTTP request model used by the AppTheory runtime.
type Response ¶
type Response struct {
Status int
Headers map[string][]string
Cookies []string
Body []byte
IsBase64 bool
}
Response is the canonical HTTP response model returned by AppTheory handlers.
type RouteOption ¶
type RouteOption func(*routeOptions)
func RequireAuth ¶
func RequireAuth() RouteOption
type SpanRecord ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
lift-migrate
command
|
|
|
contract-tests
|
|
|
runners/go
command
|
|
|
examples
|
|
|
cdk/multilang/handlers/go
command
|
|
|
migration/rate-limited-http
command
|
|
|
pkg
|
|
|
limited
Package limited provides DynamoDB-backed rate limiting for AppTheory.
|
Package limited provides DynamoDB-backed rate limiting for AppTheory. |
|
limited/middleware
Package middleware provides HTTP middleware for the AppTheory limited rate limiter.
|
Package middleware provides HTTP middleware for the AppTheory limited rate limiter. |
Click to show internal directories.
Click to hide internal directories.