Documentation ¶
Index ¶
- Constants
- func Parse(filename string, b []byte, opts ...Option) (interface{}, error)
- func ParseFile(filename string, opts ...Option) (interface{}, error)
- func ParseReader(filename string, r io.Reader, opts ...Option) (interface{}, error)
- func ParseToMetricFilter(dsl string) (model.MetricFilter, error)
- type Option
Constants ¶
View Source
const ( MetricMax metricType = 1 MetricMin metricType = 2 MetricAvg metricType = 3 MetricMed metricType = 4 MetricMdev metricType = 5 MetricLoss metricType = 6 MetricCount metricType = 7 MetricPckSent metricType = 8 MetricPckReceived metricType = 9 MetricNumAgent metricType = 10 MetricNumTarget metricType = 11 )
Variables ¶
This section is empty.
Functions ¶
func ParseReader ¶
ParseReader parses the data from r using filename as information in the error messages.
func ParseToMetricFilter ¶
func ParseToMetricFilter(dsl string) (model.MetricFilter, error)
Types ¶
type Option ¶
type Option func(*parser) Option
Option is a function that can set an option on the parser. It returns the previous setting as an Option.
func Debug ¶
Debug creates an Option to set the debug flag to b. When set to true, debugging information is printed to stdout while parsing.
The default is false.
func Memoize ¶
Memoize creates an Option to set the memoize flag to b. When set to true, the parser will cache all results so each expression is evaluated only once. This guarantees linear parsing time even for pathological cases, at the expense of more memory and slower times for typical cases.
The default is false.
Click to show internal directories.
Click to hide internal directories.