-
Notifications
You must be signed in to change notification settings - Fork 0
AWS technical overview
Function.cs
Contains the Function
class, which contains our lambda functions. The APIGatewayProxyRequest
class that goes in those functions is a standard way to get information in the lambda function in C#, for the request used to invoke the function. The APIGatewayProxyResponse
we output is also standard.
public APIGatewayProxyResponse HTranspile_SingleDmlToSingleJson(APIGatewayProxyRequest request, ILambdaContext context)
public APIGatewayProxyResponse HTranspile_SingleDmlToSingleJsonListiary(APIGatewayProxyRequest request, ILambdaContext context)
public APIGatewayProxyResponse HTranspile_SingleDmlToSingleXml(APIGatewayProxyRequest request, ILambdaContext context)
public APIGatewayProxyResponse HTranspile_SingleDmlToSingleHtml(APIGatewayProxyRequest request, ILambdaContext context)
public APIGatewayProxyResponse HTranspile_SingleDmlToSingleHtmlPlain(APIGatewayProxyRequest request, ILambdaContext context)
StatusCode is 200 here. The headers we include indicate that we are sending JSON.
The Body is our JSON - the data we output from the lambda function.
We get it by converting an OutputJson
class to JSON, as shown below.
var response = new APIGatewayProxyResponse
{
StatusCode = (int)HttpStatusCode.OK,
Body = JsonConvert.SerializeObject(outputJson),
Headers = new Dictionary<string, string> { { "Content-Type", "application/json" }, { "Access-Control-Allow-Origin", "*" } }
};
return response;
This class represents the result of the execution of one of our lambda functions. Command - The command we ran - like "parse-file" Result - A string like "Success" Logs - the generated log entries from the Transpiler Output - The transpiled result in a base64 encoded string - we decode it to get our JSON, HTML, XML etc.
public class OutputJson
{
public string? Command { get; set; }
public string? Result { get; set; }
public string? Logs { get; set; }
public string? Output { get; set; }
}
The aws-configs
folder contains configuration files for all the different lambda functions in the project, for the AWS toolbox.
The thing is that the AWS tools for Visual Studio offer us a way to publish only one lambda at a time, from within Visual Studio. Within the project containing the lambda function we have a file named aws-lambda-tools-defaults.json
, (which file has its build action set to none) so when we right click on the project and select Publish to AWS Lambda...
, the AWS tools extension uses this configuration file to determine what to upload to where. This is why we have a folder full of those configs - when we want to upload a specific function, we simply copy that specific config under the main project and rename it accordingly by removing the prefix (like removing "HTML_PLAIN ").
Those are the functions that do the transpilation.
We currently don't have lambda functions that utilize CompileMulty
though.
internal static string? Compile(string code)
internal static string? CompileMulty(List<KeyValuePair<string, string>> codes)
This static class contains all the data for the current parse job.
This static class contains methods for reading data into the Datnik.
This static class contains all the methods that has to do with logging messages.
Home
Grammar How To
Compiler How To
CLI Compiler - How to
CLI Compiler - How to - help
CLI Compiler - How to - parse-file
CLI Compiler - How to - parse-folder
CLI Compiler - How to - encrypt-file
CLI Compiler - How to - decrypt-file
CLI Compiler - How to - recrypt-file
CLI Compiler - How to - encrypt-folder
CLI Compiler - How to - decrypt-folder
CLI Compiler - How to - recrypt-folder
API Compiler - How to
API Compiler - How to - Example 1
API Compiler - How to - Example 2
API Compiler - How to - Example 3
API Compiler - How to - Example 4
API Compiler - How to - Example 5
AWS Compiler - How to
AWS technical overview
API gateway configuration
output - low
output - medium
output - high
output - themes
Grammar - Lists
Grammar - Comments
Grammar - Links
Grammar - Decorators
Grammar - Tags
Grammar - More on Tags
Grammar - Directives
Grammar - Dot Notation
Grammar - Tildes
Grammar - Files
Deprecated - Slash Notation
Deprecated - Delimiter Mode
Describe Basics - v0.6
Describe Tags - v0.7
Describe Links - v0.8
Describe Decorators - v0.9
Describe Lines - v1.0
Describe Doubles - v1.1