Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestIfNeedBacktracking ¶
TestIfNeedBacktracking tests if backtrack is needed for given list of mappings and whether ordering is disabled.
Types ¶
type FSM ¶
type FSM struct { BacktrackingNeeded bool OrderingDisabled bool // contains filtered or unexported fields }
func (*FSM) AddState ¶
func (f *FSM) AddState(match string, matchMetricType string, maxPossibleTransitions int, result interface{}) int
AddState adds a mapping rule into the existing FSM. The maxPossibleTransitions parameter sets the expected count of transitions left. The result parameter sets the generic type to be returned when fsm found a match in GetMapping.
func (*FSM) GetMapping ¶
GetMapping using the fsm to find matching rules according to given statsdMetric and statsdMetricType. If it finds a match, the final state and the captured strings are returned; if there's no match found, nil and a empty list will be returned.
type TemplateFormatter ¶
type TemplateFormatter struct {
// contains filtered or unexported fields
}
func NewTemplateFormatter ¶
func NewTemplateFormatter(template string, captureCount int) *TemplateFormatter
NewTemplateFormatter instantiates a TemplateFormatter from given template string and the maximum amount of captures.
func (*TemplateFormatter) Format ¶
func (formatter *TemplateFormatter) Format(captures []string) string
Format accepts a list containing captured strings and returns the formatted string using the template stored in current TemplateFormatter.