Documentation

Overview

    Package validators provides an entrypoint for the cloudprober's validators framework.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func RunValidators

    func RunValidators(vs []*Validator, input *Input, validationFailure *metrics.Map, l *logger.Logger) []string

      RunValidators runs the list of validators on the given response and responseBody, updates the given validationFailure map and returns the list of failures.

      func ValidationFailureMap

      func ValidationFailureMap(vs []*Validator) *metrics.Map

        ValidationFailureMap returns an initialized validation failures map.

        Types

        type Input

        type Input struct {
        	Response     interface{}
        	ResponseBody []byte
        }

          Input encapsulates the input for validators.

          type Validator

          type Validator struct {
          	Name     string
          	Validate func(input *Input) (bool, error)
          }

            Validator implements a validator.

            A validator runs a test on the provided input, usually the probe response, and returns the test result. If test cannot be run successfully for some reason (e.g. for malformed input), an error is returned.

            func Init

            func Init(validatorConfs []*configpb.Validator, l *logger.Logger) ([]*Validator, error)

              Init initializes the validators defined in the config.

              Source Files

              Directories

              Path Synopsis
              Package http provides an HTTP validator for the Cloudprober's validator framework.
              Package http provides an HTTP validator for the Cloudprober's validator framework.
              Package integrity provides data integrity validator for the Cloudprober's validator framework.
              Package integrity provides data integrity validator for the Cloudprober's validator framework.
              Package regex provides regex validator for the Cloudprober's validator framework.
              Package regex provides regex validator for the Cloudprober's validator framework.