filter

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package filter implements common filters for the RDS (resource discovery service) providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FreshnessFilter

type FreshnessFilter struct {
	// contains filtered or unexported fields
}

FreshnessFilter implements a filter that succeeds only if the given time is within a pre-defined duration.

func NewFreshnessFilter

func NewFreshnessFilter(dStr string) (*FreshnessFilter, error)

NewFreshnessFilter returns a new freshness filter.

func (*FreshnessFilter) Match

func (ff *FreshnessFilter) Match(t time.Time, l *logger.Logger) bool

Match returns true if the given time is within a pre-defined duration.

type RegexFilter

type RegexFilter struct {
	// contains filtered or unexported fields
}

RegexFilter implements a regex based filter.

func NewRegexFilter

func NewRegexFilter(regexStr string) (*RegexFilter, error)

NewRegexFilter returns a new regex filter.

func (*RegexFilter) Match

func (rf *RegexFilter) Match(name string, l *logger.Logger) bool

Match returns true if provided string matches the regex of the filter. Otherwise, false is returned.

Jump to

Keyboard shortcuts

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