Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvalJSONPath ¶
EvalJSONPath evaluates a JSONPath expression against a ParseOrderedJSON root.
func JavaString ¶
JavaString renders a template value the way Java's toString would.
func MapGet ¶
MapGet looks key up in a ParseOrderedJSON object; ok is false for non-objects or absent keys.
func ParseOrderedJSON ¶
ParseOrderedJSON decodes JSON into template values (insertion-ordered maps).
Types ¶
type Context ¶
type Context struct {
// StageVariables is exposed as $stageVariables.X.
StageVariables map[string]string
// Authorizer is exposed as $context.authorizer.
Authorizer map[string]any
// Extra adds further $context.<key> entries (e.g. WebSocket connectionId, routeKey).
Extra map[string]any
// Headers, QueryParams and PathParams feed $input.params().
Headers map[string]string
QueryParams map[string]string
PathParams map[string]string
// Body is the raw request body passed as $input.body.
Body string
// RequestID is exposed as $context.requestId.
RequestID string
// HTTPMethod is exposed as $context.httpMethod.
HTTPMethod string
// ResourcePath is exposed as $context.resourcePath (the route template, e.g. /users/{id}).
ResourcePath string
// Path is exposed as $context.path (the actual request path).
Path string
// Stage is exposed as $context.stage.
Stage string
// APIID is exposed as $context.apiId.
APIID string
// AccountID is exposed as $context.accountId.
AccountID string
// DomainName is exposed as $context.domainName.
DomainName string
// SourceIP is exposed as $context.identity.sourceIp.
SourceIP string
// UserAgent is exposed as $context.identity.userAgent.
UserAgent string
}
Context holds the context variables available during VTL template rendering.