Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Good First Issues]: implement new functions for Vanus transformer #355

Open
12 of 14 tasks
JieDing opened this issue Dec 20, 2022 · 0 comments
Open
12 of 14 tasks

[Good First Issues]: implement new functions for Vanus transformer #355

JieDing opened this issue Dec 20, 2022 · 0 comments
Labels
good first issue help-wanted Extra attention is needed

Comments

@JieDing
Copy link
Contributor

JieDing commented Dec 20, 2022

Motivation

Vanus Functions are a series of pre-built functions worked within Vanus transformer. By choosing a function, users can specify the way that events will be changed.

It will be a good start if you decide to contribute to Vanus codes.

Details

For example, if users' original event looks like this:

{
    "specversion" : "1.0",
    "type" : "com.example.someevent",
    "source" : "/mycontext",
    "subject": null,
    "id" : "C234-1234-1234",
    "time" : "2018-04-05T17:31:00Z",
    "comexampleextension1" : "value",
    "comexampleothervalue" : 5,
    "datacontenttype" : "application/json",
    "data" : {
        "appinfoA" : "abc",
        "appinfoB" : 123,
        "appinfoC" : true
    }
}

Now we can make some changes to the original event by creating a function pipeline. All functions will be executed by the order of functions defined in the pipeline. Each function consists of a function name and an array of function parameters .
For example, the create function below will create a new json node with the key "data.source", and the value of JSON node "$.source". And the delete function below will delete the json node with the key "$.data.appinfoA".

"pipeline":[
    {"command":["create","$.data.source","$.source"]},
    {"command":["delete","$.data.appinfoA"]}
]

Function List

structs

strings

array

datetime

math

condition

How to join the event

If you want to implement a specific function, please leave a comment in corresponding issues like:

I'd like to implement this function, please assign this issue to me.

Vanus community will assign the issue to you on time.

Submit a pull request to suggest your changes.

@JieDing JieDing added help-wanted Extra attention is needed good first issue labels Dec 20, 2022
@JieDing JieDing pinned this issue Dec 20, 2022
@Michaelg22 Michaelg22 unpinned this issue Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue help-wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant