https://github.com/opslevel/opslevel-jq-parser
A jq wrapper which aids in converting data to opslevel-go input structures
https://github.com/opslevel/opslevel-jq-parser
Last synced: over 1 year ago
JSON representation
A jq wrapper which aids in converting data to opslevel-go input structures
- Host: GitHub
- URL: https://github.com/opslevel/opslevel-jq-parser
- Owner: OpsLevel
- License: mit
- Created: 2023-11-01T18:08:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-06T17:16:44.000Z (over 1 year ago)
- Last Synced: 2025-01-06T18:28:37.584Z (over 1 year ago)
- Language: Go
- Size: 196 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://app.opslevel.com/services/opslevel-jq-parser/maturity-report)
# opslevel-jq-parser
A jq wrapper which aids in converting data to opslevel-go input structures
This library leverages https://github.com/flant/libjq-go which are CGO bindings to the JQ library which provide C native speed
# Installation
```bash
go get github.com/opslevel/opslevel-jq-parser/v2024
```
Then wherever you compile or test that project you'll need to add
```bash
docker run --name "libjq" -d flant/jq:b6be13d5-glibc
docker cp libjq:/libjq ./libjq
docker rm libjq
export CGO_ENABLED=1
export CGO_CFLAGS="-I$(pwd)/libjq/include"
export CGO_LDFLAGS="-L$(pwd)/libjq/lib"
```
Here is a nice stanza you can put into your GitHub Actions workflow files
> NOTE: the version is important - please see https://github.com/flant/libjq-go#notes
```yaml
- name: Setup LibJQ
run: |-
docker run --name "libjq" -d flant/jq:b6be13d5-glibc
docker cp libjq:/libjq ./libjq
docker rm libjq
echo CGO_ENABLED=1 >> $GITHUB_ENV
echo CGO_CFLAGS="-I$(pwd)/libjq/include" >> $GITHUB_ENV
echo CGO_LDFLAGS="-L$(pwd)/libjq/lib" >> $GITHUB_ENV
```