Documentation ¶
Overview ¶
Package to handle Geneos Gateway specific XPaths
These are a subset of the W3C XPath 1.0 standard and this package is only interested in absolute paths and no matching is done. Geneos XPaths are of a particular hierarchy and the ones we are interesting in here are those used to communicate with the Gateway REST command API.
The two types of path handled are for headline or table cells, which have the form:
/geneos/gateway/directory/probe/managedEntity/sampler/dataview/ ...
... headlines/cell or ... rows/row/cell
Each component except "geneos", "directory", "headlines" and "rows" can have a name and other predicates. The path can terminate at any level that can carry a name. Apart from names, only attributes in managedEntities are currently handled in anyway.
Index ¶
- Variables
- func SplitWithEscaping(s string, separator, escape byte) []string
- type Column
- type Dataview
- type Entity
- type Gateway
- type Headline
- type Probe
- type Row
- type Sampler
- type XPath
- func (x *XPath) IsDataview() bool
- func (x *XPath) IsEmpty() bool
- func (x *XPath) IsEntity() bool
- func (x *XPath) IsGateway() bool
- func (x *XPath) IsHeadline() bool
- func (x *XPath) IsProbe() bool
- func (x *XPath) IsSampler() bool
- func (x *XPath) IsTableCell() bool
- func (x *XPath) SetGatewayName(gateway string)
- func (x *XPath) String() (path string)
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidPath = errors.New("invalid Geneos XPath")
Functions ¶
func SplitWithEscaping ¶
Types ¶
type XPath ¶
type XPath struct { Gateway *Gateway `json:"gateway,omitempty"` Probe *Probe `json:"probe,omitempty"` Entity *Entity `json:"entity,omitempty"` Sampler *Sampler `json:"sampler,omitempty"` Dataview *Dataview `json:"dataview,omitempty"` Headline *Headline `json:"headline,omitempty"` Rows bool `json:"-"` Row *Row `json:"row,omitempty"` Column *Column `json:"column,omitempty"` }
A Geneos Gateway XPath
Each field is a pointer, which if nil means the Xpath terminates at that point The "rows" boolean indicates in lower level components are headlines or rows
func NewDataviewPath ¶
return an xpath populated to the dataview, with name dv
func NewHeadlinePath ¶
return an xpath populated to the headline cell, identified by headline
func NewTableCellPath ¶
return an xpath populated to the table cell identifies by row and column
func Parse ¶
parse a string into a Geneos XPath structure or return an error very simplistic and hardwired to geneos absolute xpaths no support for embedded separators