Skip to content

ca0s/jsonfilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

# jsonfilter

Apply filters defined as JSON strings to arbitrary Gp structs.

For example, having the following object:

type Internal struct {
    data string
}
type MyData struct {
    internal Internal
    what int
}

obj := MyData {
    internal: Internal{
        data: "nope"
    },
    what: 5
}

And the filter:

{
    "$or": [
        {
            "internal.data": {
                "$eq": "something"
            }
        },
        {
            "$and": [
                {
                    "what": {
                        "$gt": 1
                    },
                },
                {
                    "what": {
                        "$lt": 10
                    }
                }
            ]
        }
    ]
}

It would return true.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages