regex

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package regex provides regex validator for the Cloudprober's validator framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

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

Validator implements a regex validator.

func (*Validator) Init

func (v *Validator) Init(config interface{}, l *logger.Logger) error

Init initializes the regex validator. It compiles the regex in the configuration and returns an error if regex doesn't compile for some reason.

func (*Validator) Validate

func (v *Validator) Validate(unusedResponseObj interface{}, responseBody []byte) (bool, error)

Validate the provided responseBody and return true if responseBody matches the configured regex.

Jump to

Keyboard shortcuts

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