Documentation ¶
Overview ¶
Package reporting provides structures and functions for reporting of errors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToGolangPath ¶
Translate the path to a Golang access path.
The name segments are expected to denote the names of the properties in Golang, not JSON property names.
func ToJSONPath ¶
Translate the path to a JSON path.
The name segments are expected to denote the names of the properties in JSON property names, not Golang property names.
func ToRelativeXPath ¶
Generate a relative XPath based on the path segments.
Leave out the leading slash (`/`). This is helpful if we want to embed the error report in a larger document with a prefix *etc.*
Types ¶
type IndexSegment ¶
type IndexSegment struct {
Index int
}
type NameSegment ¶
type NameSegment struct {
Name string
}
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
func (*Path) OverSegments ¶
func (p *Path) OverSegments(callback func(interface{}))
Apply the `callback` on each segment.
The segment object is either a NameSegment or a IndexSegment.
func (*Path) PrependIndex ¶
func (p *Path) PrependIndex(segment *IndexSegment)
Prepend the index segment to the path.
func (*Path) PrependName ¶
func (p *Path) PrependName(segment *NameSegment)
Prepend the name segment to the path.