Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/vendor/github.com/go-openapi/jsonpointer
renovate-sh-app[bot] 9e3f94ba4c
fix(deps): update module github.com/prometheus/alertmanager to v0.31.0 (main) (#20692)
4 months ago
..
.cliff.toml fix(deps): update module github.com/prometheus/alertmanager to v0.31.0 (main) (#20692) 4 months ago
.editorconfig
.gitignore fix(deps): update module github.com/prometheus/alertmanager to v0.31.0 (main) (#20692) 4 months ago
.golangci.yml fix(deps): update module github.com/prometheus/alertmanager to v0.31.0 (main) (#20692) 4 months ago
CODE_OF_CONDUCT.md
CONTRIBUTORS.md fix(deps): update module github.com/prometheus/alertmanager to v0.31.0 (main) (#20692) 4 months ago
LICENSE fix(deps): update module github.com/prometheus/alertmanager to v0.31.0 (main) (#20692) 4 months ago
NOTICE fix(deps): update module github.com/prometheus/alertmanager to v0.31.0 (main) (#20692) 4 months ago
README.md fix(deps): update module github.com/prometheus/alertmanager to v0.31.0 (main) (#20692) 4 months ago
SECURITY.md fix(deps): update module github.com/prometheus/alertmanager to v0.31.0 (main) (#20692) 4 months ago
errors.go fix(deps): update module github.com/prometheus/alertmanager to v0.31.0 (main) (#20692) 4 months ago
pointer.go fix(deps): update module github.com/prometheus/alertmanager to v0.31.0 (main) (#20692) 4 months ago

README.md

jsonpointer

Tests Coverage CI vuln scan CodeQL

Release Go Report Card CodeFactor Grade License

GoDoc Slack Channelslack-badge go version Top language Commits since latest release


An implementation of JSON Pointer for golang, which supports go struct.

Status

API is stable.

Import this library in your project

go get github.com/go-openapi/jsonpointer

Basic usage

See also some examples

Retrieving a value

  import (
    "github.com/go-openapi/jsonpointer"
  )


  var doc any

  ...

	pointer, err := jsonpointer.New("/foo/1")
	if err != nil {
		... // error: e.g. invalid JSON pointer specification
	}

	value, kind, err := pointer.Get(doc)
	if err != nil {
		... // error: e.g. key not found, index out of bounds, etc.
	}

  ...

Setting a value

  ...
  var doc any
  ...
	pointer, err := jsonpointer.New("/foo/1")
	if err != nil {
		... // error: e.g. invalid JSON pointer specification
  }

	doc, err = p.Set(doc, "value")
	if err != nil {
		... // error: e.g. key not found, index out of bounds, etc.
	}

Change log

See https://github.com/go-openapi/jsonpointer/releases

References

https://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07

also known as RFC6901

Licensing

This library ships under the SPDX-License-Identifier: Apache-2.0.

See the license NOTICE, which recalls the licensing terms of all the pieces of software on top of which it has been built.

Limitations

The 4.Evaluation part of the previous reference, starting with 'If the currently referenced value is a JSON array, the reference token MUST contain either...' is not implemented.

That is because our implementation of the JSON pointer only supports explicit references to array elements: the provision in the spec to resolve non-existent members as "the last element in the array", using the special trailing character "-" is not implemented.

Other documentation

Cutting a new release

Maintainers can cut a new release by either:

  • running this workflow
  • or pushing a semver tag
    • signed tags are preferred
    • The tag message is prepended to release notes