queryparser

package
v3.1.4+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2016 License: MIT Imports: 8 Imported by: 1

README

Package queryparser parses the Conditions = xyz query.

Spec

# Given data:
#   /r/load-avg: {"Data": {"LoadAvg1m": 0.904296875}}

# 1. Every part must be defined inside parenthesis.
((/r/load-avg.LoadAvg1m > 0.5) && (/r/load-avg.LoadAvg1m < 10))

# 2. Boolean operator: &&, ||
# 3. Numerical operator: typical
# 4. String operator: ==, !=

Tags:

tags.role == "appserver"
tags.environment != "prod"

Name:

# Hostname matcher
name == "didip-mac-mini.local"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryParser

type QueryParser struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(data map[string][]byte, tags map[string]string) *QueryParser

func (*QueryParser) Parse

func (qp *QueryParser) Parse(query string) (bool, error)

func (*QueryParser) SetTags

func (qp *QueryParser) SetTags(tags map[string]string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL