An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          



License


Made With Go


Release


Issues


Contributors


Activity


CodeCov


Dependabot


Go Reference

[![Overall](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fapp.opslevel.com%2Fapi%2Fservice_level%2FAN4c4UlHKKLbrHAlFzF4FKXpeGYnjEtC5765UYF1Exc)](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
```