Skip to content

A jq wrapper which aids in converting data to opslevel-go input structures

License

Notifications You must be signed in to change notification settings

OpsLevel/opslevel-jq-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License Made With Go Release Issues Contributors Activity CodeCov Dependabot Go Reference

Overall

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

go get github.com/opslevel/opslevel-jq-parser/v2024

Then wherever you compile or test that project you'll need to add

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

      - 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

About

A jq wrapper which aids in converting data to opslevel-go input structures

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages