-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
d8deeea
commit 491ef15
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,34 @@ | ||
import std.stdio; | ||
import std.json; | ||
|
||
import lambd.layer; | ||
import lambd.bootstrap; | ||
|
||
void main() | ||
{ | ||
writeln("Edit source/app.d to start your project."); | ||
// | ||
// Initialize the context | ||
// Normally this is coming from the AWS Lambda infrastructure | ||
auto myctx = LambdaContext ("myfunc", | ||
"somefakearn", | ||
"1.0.0", | ||
512, /* mb */ | ||
"someloggroupname", | ||
"somelogstreamname", | ||
"somefakeawsrequestID", | ||
3000, /* only run for 3000ms */ | ||
parseJSON("{}"), /* Fill in with an AWS identity JSON */ | ||
parseJSON("{}") /* Fill in with some AWS client context */ | ||
); | ||
// | ||
// Create a fake event | ||
// | ||
JSONValue evt = parseJSON("{}"); | ||
evt.object["count"] = JSONValue(20); | ||
// XXX TODO: Move this into some test harness code | ||
// For now this serves as an executable tester | ||
JSONValue result = handler(evt, myctx); | ||
|
||
// dump to string for visual inspection | ||
writeln("results:", result.toString()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters