Categorygithub.com/hypolas/readjsonfromflatpath
repositorypackage
0.0.3
Repository: https://github.com/hypolas/readjsonfromflatpath.git
Documentation: pkg.go.dev

# README

Exemple

{
  "hostname": "myhost",
  "services": [
    {
      "nom": "nginx",
      "status": "up"
    },
    {
      "nom": "httpd",
      "status": "down"
    }
  ]
}

The hostname can be find with:

  • services

The status of httpd can be find with:

  • services__1__status

The name of first service can be find with:

  • services__0__nom

Can be work with environnement variable:

  • HYPOLAS_HEALTHCHECK_HTTP_JSON
  • HYPOLAS_READ_JSON
export HYPOLAS_HEALTHCHECK_HTTP_JSON=services__0__nom
export HYPOLAS_READ_JSON=services__0__nom

Entrypoint:

ReadJSONFromFlatPath(jpath string, jsonFile []byte)

If jpath is empty, module with try HYPOLAS_HEALTHCHECK_HTTP_JSON and HYPOLAS_READ_JSON.