webql

Crates.iowebql
lib.rswebql
version0.1.0
sourcesrc
created_at2022-10-28 06:48:22.44595
updated_at2022-10-28 06:48:22.44595
descriptionWebQL is a library that allows to get data from multiple resources or JSON and filter the result
homepagehttps://github.com/rusty-ferris-club/webql
repositoryhttps://github.com/rusty-ferris-club/webql
max_upload_size
id700161
size111,582
Elad Kaplan (kaplanelad)

documentation

https://docs.rs/webql/latest/webql

README

webql

Crates.io CI WebQL is a library that allows to get data from multiple resources or JSON and filter the result.

Usage

[dependencies]
webql = { version = "0.1.0" }

Feature flags

  • github feature flag for filter pull request data.

Examples

use serde_json::json;
let json = json!({
        "url": "https://github.com/rusty-ferris-club/webql",
        "body": "some example",
        "labels": [
            {
                "name": "label-1",
            },
            {
                "name": "label-2",
            },
        ],
        "user" : {
            "login": "kaplanelad"
        }
    });
    let filters = vec![
        Filter {
            query: r#""user"."login""#.to_string(),
            operation: Operation::Equal,
            values: vec!["kaplanelad".to_string()],
        },
        Filter {
            query: r#""labels"|={"name"}."name""#.to_string(),
            operation: Operation::Equal,
            values: vec!["label-1".to_string()],
        },
        Filter {
            query: r#""body""#.to_string(),
            operation: Operation::Contains,
            values: vec!["example".to_string()],
        },
    ];
    jfilter::is_match_filters(&json, &filters)

All the examples here

Thanks

To all Contributors - you make this happen, thanks!

Copyright

Copyright (c) 2022 @kaplanelad. See LICENSE for further details.

Commit count: 7

cargo fmt