Help Center/
FunctionGraph/
Developer Guide (Ally Region)/
Developing Functions/
Developing Functions in Cangjie/
Developing an Event Function
Updated on 2026-01-08 GMT+08:00
Developing an Event Function
You can compile a function only via uploading a ZIP package with all required dependencies.
Preparation
Obtain the Cangjie demo project package from technical support.
Compiling and Packaging
Run the cjpm build command to generate a libxxxx.so file in the build directory. You need to compress the .so file into a .zip file, as shown in Figure 1.
Creating a Function
- Log in to the FunctionGraph console and click Create Function in the upper right corner. The Create Function page is displayed.
- Select Create from scratch and set the following parameters:
- Function Type: Select Event Function.
- Region: Select a region.
- Function Name: Enter a custom name.
- Enterprise Project: Select an enterprise project as required.
- Agency: Select an existing agency. For details about how to create an agency, see section "Creating an Agency" in the FunctionGraph User Guide.
- Runtime: select Cangjie 1.0.
- Click Create Function.
Configuring Functions
- Return to the FunctionGraph console, choose Functions > Function List on the left, locate the created function, and click its name. The function details page is displayed.
- On the Code tab page, choose Upload > Local ZIP > Select File on the right to upload the prepared demo package. After the upload is successful, click OK.
- Choose Configuration > Basic Settings. Set the handler to the name of the .so file in Compiling and Packaging, for example, libuser_func_test_success.so, and click Save.
Testing Function Invocation
- On the function details page, choose Code > Configure Test Event. In the dialog box that is displayed, click Create new test event > Blank Template.
The contents of the test cases are as follows:
{ "isBase64Encoded": false, "httpMethod": "POST", "path": "", "body": "test_cangjie" }
Parameters must be transferred based on the APIGTriggerEvent class defined in the Yuanrong SDK. Otherwise, serialization and deserialization exceptions may occur.public open class APIGTriggerEvent { private var isBase64Encoded: Bool = false; private var httpMethod: String = "POST"; private var path: String = ""; private var body: String = ""; } - After the test event is configured, click Test.
Parent topic: Developing Functions in Cangjie
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot
