Initializing Lyrid App
#
Creating new ApplicationUser will be able to initialize their function using the following command:
note
- The language option is currently "go1.x", "python3.7", "python3.8", "nodejs12.x", and "dotnetcore3.1".
- We also support some Web Frameworks, the feature is currently in beta, but you can start using it. Read More
- Beta Web Frameworks : Express for NodeJS, ASP.NET Core, Flask for Python, Django for Python, and Gin for Golang.
#
File StructureThe user will then be presented with a few files that have this structure:
- Go
- Python
- NodeJS
- C#
#
Entry FunctionEntry function is the location that will be the wrapped by the platform to create a Lyrid Function.
#
MainMain is the way user can test their function locally. The user will be able to test the input/output of their functions and execute them locally by giving the function the appropriate parameter. User will be able to call the following in order to create an executable that can be launched locally:
- Go
- Python
- NodeJS
- C#
#
Environment VariableEnvironment variable is how the user can pass information into the system and retrieve it by using the environment variable calls. You will be able to get these string variables by calling:
- Go
- Python
- NodeJS
- C#
Restricted Variable
Some of the variables are reserved by the platform. The Lyrid platform will automatically update these following values at the time of build:
CLOUD_ENV ------------- The current execution cloud framework.
Possible Values : AWS (Amazon), GCP (Google), LYR (Lyrid), Local
TEMP_DIR ------------- File system writable temporary directory.
Possible Values : . (Google/Lyrid/Local), /tmp (Amazon)
#
Module DefinitionThe Module Definition is the definition of the current module in the folder. The user will be able to create more function entry points into the module using this definition. Only function that is listed inside this definition is the one that will be wrapped by the platform into Lyrid Function that can be launched by different serverless cloud platform.
After the user initializes their function, they will be able to update the entry point, and create their source code package within the folder.
#
External DependencyAny external dependency that cannot be pulled by the Internet (by "go get"/"pip"/"npm install"/"dotnet restore") needs to be placed into the same folder.
#
Start CodingAfter understanding the file structure , you can start your first code !